G
Guest
I am opening a word document from Excel VBA code ... The word doucment is a mail merge document linked to another excel fil
I use the follwoing code
dim docpath as strin
docpath = "C:\MailMerge\MailMerge.doc
On error resume nex
dim wd as objec
set wd = Getobject(,"Word.Application") ' If word is not running this will generate an erro
if err.number <> 0 then ' word is running otherwise word is not runnin
msgbox err.number & "-" & err.descriptio
' this if statement is only for debuggin
endi
if wd is Nothing the
set wd = "Word.Application
EndI
wd.Application.Documents.Open Filename:=docpath, Readonly:= Tru
The problem is: It takes about 30 - 40 seconds to open the word document through VBA code where as If I just double click the word file in explorer it just take 3-5 seconds
How can I improve the speed when I open the word file through VBA code
Any help would be appreciated.
I use the follwoing code
dim docpath as strin
docpath = "C:\MailMerge\MailMerge.doc
On error resume nex
dim wd as objec
set wd = Getobject(,"Word.Application") ' If word is not running this will generate an erro
if err.number <> 0 then ' word is running otherwise word is not runnin
msgbox err.number & "-" & err.descriptio
' this if statement is only for debuggin
endi
if wd is Nothing the
set wd = "Word.Application
EndI
wd.Application.Documents.Open Filename:=docpath, Readonly:= Tru
The problem is: It takes about 30 - 40 seconds to open the word document through VBA code where as If I just double click the word file in explorer it just take 3-5 seconds
How can I improve the speed when I open the word file through VBA code
Any help would be appreciated.