Hello,
I'm having an issue with a macro i'm writing.
I got a .xls file in which I have put a Workbook_Open and a Workbook_BeforeClose modules; all they do is to LOAD another .xls file, find the last row in it, write down the word "Open" (in _Open) or "Close" (in _BeforeClose), followed by the actualtime and the user that actually used the file. All works perfectly, if I open or close MANUALLY the file:
Here's the code, pretty simple:
The problem: the main file (strWorkbookName) in which these modules reside is not designed to be edited manually, but through an UserForm residing in yet another file.
When the UserForm code calls for strWorkbookName:
it opens regularly, and so does the "archive.xls" his Workbook_open calls for, but when it' being closed:
it steps through the _BeforeClose module without executing:
- does NOT open "archive.xls"
- does NOT go to cell "A1"
- DOES loop through the Do Until...Loop, but since excel is locked on a non-empty cell, continues looping ad infinitum.
What I did wrong?
Bookmarks