W
Wes
First post, please be kind.
Have just dived into the world of VBA, quite facinating I must say. Have
found this board VERY useful. I have searched for answers to my problems and
have always found the answers, but not for this one, even though there are
numerous post concerning this very subject.
So here we go...
Have written a Macro in Word, it works just fine.
Have written VBA code in Access, it works just fine.
Would like to call/run the Word Macro from Access and then continue on with
my Access code, my head hurts from banging it against a brick wall trying to
figure this out.
Here is what I have so far in Access to call/run the Word Macro.
Sub Word_Macro()
Dim myWD As Object
Dim myFile As Object
Set myWD = CreateObject("Word.Application")
Set myFile = myWD.Documents.Open("c:\mypath\config sfs macro.doc")
myWD.Run "SFs_ConfigHeader"
myFile.Close
myWD.Quit
Set myFile = Nothing
Set myWD = Nothing
End Sub
All works well until I get to - myFile.Close-, I am then treated to a very
nasty error box that states "Run-Time error '462': The remote Server Machine
does not exist or is unavailable".
Have gone into Access and made Word objects available ( I think, pretty sure
I did, yeah, I did, I think). Just so yall know.
Some help would be appreciated.
wes
Have just dived into the world of VBA, quite facinating I must say. Have
found this board VERY useful. I have searched for answers to my problems and
have always found the answers, but not for this one, even though there are
numerous post concerning this very subject.
So here we go...
Have written a Macro in Word, it works just fine.
Have written VBA code in Access, it works just fine.
Would like to call/run the Word Macro from Access and then continue on with
my Access code, my head hurts from banging it against a brick wall trying to
figure this out.
Here is what I have so far in Access to call/run the Word Macro.
Sub Word_Macro()
Dim myWD As Object
Dim myFile As Object
Set myWD = CreateObject("Word.Application")
Set myFile = myWD.Documents.Open("c:\mypath\config sfs macro.doc")
myWD.Run "SFs_ConfigHeader"
myFile.Close
myWD.Quit
Set myFile = Nothing
Set myWD = Nothing
End Sub
All works well until I get to - myFile.Close-, I am then treated to a very
nasty error box that states "Run-Time error '462': The remote Server Machine
does not exist or is unavailable".
Have gone into Access and made Word objects available ( I think, pretty sure
I did, yeah, I did, I think). Just so yall know.
Some help would be appreciated.
wes