Is there anybody who could tell me how to make a macro who will open ms word file. I did it with xl files and it was working but dont know how to open word file.
I don't know how to do it but let me get it straight for others... Do you want to create a button to open an MS Word Document FROM Excel? ...or... Do you want to open a MS Word Document IN Excel?
Im not very clued up about office macro's... but its only visual basic! Have you got the origional code for the xl version? im sure i coudl try to make sense of it? [Is it commented... please say you commented it! (REM's)]
You can make macro by using codes or their function. I know both of them but none was working for me. I thought may b I m wrong somewhere. Then I decided to post here.
Here is an example Sub Stat_Manager_March() ' ' Stat_Manager_March Macro ' Macro recorded 3/3/2006 by karanislove ' ' Workbooks.Open Filename:= _ "H:\New Folder\Stat Manager\Stat Manager - March 2006.xls" 'This will open stat manager march2006 xl sheet End Sub Yea, it seems easy if I would like to change this function to make it workin with word for e.g Sub Current_Promotions() ' ' Current_Promotions Macro ' Macro recorded 3/12/2006 by karanislove ' ' Workbooks.Open Filename:= _ "H:\New Folder\Promotions\Current Promotions.doc" 'it has to open the promotions word file End Sub I recieve an error message......which I ve attached. Its looks damn easy, just write the path of the file but i dont know y its not working......~!
It claims the file format is invalid... which (logically) means that you have addressed the file correctly :/ this might be worth a look! http://www.juixe.com/techknow/index.php/2005/11/09/more-ways-to-open-a-doc/
I got the right answer Sub LatestInformation() ' ' Latest_Information_doc Macro ' Macro recorded 3/3/2006 by karanislove Set appWd = CreateObject("Word.Application") Set doc = appWd.Documents.Open("H:\New Folder\Latest Information.doc") End Sub i found it here Code: http://groups.google.com/group/microsoft.public.word.docmanagement/browse_thread/thread/5f93984ad0f97b62/6d6ec66f8308bd9b?lnk=st&q=how+to+open+word+file+in+excel&rnum=2&hl=en#6d6ec66f8308bd9b Thanx for giving me ur time