Load a File Error 9
something like this:
Sub test2()
Dim fPath As String
Dim fname As String
Dim wb2 As Workbook
fPath = "D:\My Documents\Excel\"
fname = fPath & "Book1.xls"
Set wb2 = Workbooks.Open(Filename:=fname)
Windows(wb2.Name).Activate
End Sub
--
Gary
"Mike H." wrote in message
...
After loading a file when I issue the command
Windows(TheWb).Activate
where TheWB is the name of the file (with or without the path, doesn't
matter), I am getting an error: "Runtime Error 9, Subscript out of range".
What do I need to change?
|