Hi all,
I got 'run time error 4160 bad file name' with the following code. Any one can shed some light? That'd be much appreciated.
Basically, I was trying to control Word through Excel. The code below is in a module in Excel. The file "test.docx" is already open.
Code
Dim objWord As Object
Dim wdDoc As Object
Set objWord = GetObject(, "Word.Application")
objWord.Visible = True
objWord.Activate
Set wdDoc = objWord.Documents("test.docx")
With wdDoc
Display More
......