What is the correct syntax to activate an open workbook?
This is the scenario:
I am send a file
I obtain the file name with:
Dim vFileNames As Variant
vFileNames = Application.GetOpenFilename
While this file is open, I open another file (a static file that will always have the same name), copy information from this second file and then paste it into the original file.
How do I reactivate the original file.
(The macro recorder comes up with Windows(XXXX.XLS).activate, which will not work for variants in the file names.
After pasting the information, the static file is closed.
I tried
Workbook.vFilename.Activate
This is the scenario:
I am send a file
I obtain the file name with:
Dim vFileNames As Variant
vFileNames = Application.GetOpenFilename
While this file is open, I open another file (a static file that will always have the same name), copy information from this second file and then paste it into the original file.
How do I reactivate the original file.
(The macro recorder comes up with Windows(XXXX.XLS).activate, which will not work for variants in the file names.
After pasting the information, the static file is closed.
I tried
Workbook.vFilename.Activate