Hi everyone,
I have some issues when opening a file with the GetOpenFilename method, and then trying to close it later, with Application.Workbooks(x).Close.
Basically, this is what I'm trying to accomplish:
The issue here is that the GetOpenFilename method gets the whole path of the file, while the Application.Workbooks(x).Close method expects only the file name, and not the whole path.![]()
Please Login or Register to view this content.
Therefore I get run-time error '9', Subscript out of range.
What would be the best way to get around this?
Should I use another method to open the file, or should i create a variable that extracts the filename from the whole path, and puts it into a new variable?
Your suggestions are really appreciated!
Best regards,
Knut
Bookmarks