Greetings,
As always, thanks in advance for any replies.
I have an Excel file with macro code which opens a second Excel file and manipulates the data inside by entering data in certain cells. The code is working fine.
However, at times that second file is already open. (Only by that same user, I should add, right there on the same laptop.) When that second file is already open, I'm getting an Excel warning that saying that yes, the file is already open and re-opening will cause any changes to be discarded.
What I'd like to do in that case is NOT re-open that second file, but instead just continue to allow the macro to work by editing it, and entering additional data in some of the worksheets and cells within the file.
I can't seem to get that to work. I don't know how to reference that workbook that's already open, without opening it again.
This statement opens the second file just fine:
Set my_wkb = Workbooks.Open(Second_Filename$)
And note that I do have code to test to see if that second file is already open, and that's working fine too. But if it is already open, how do I allow my macro to continue to edit it? Do I really have to have the user save that second file, close it, and only then run the macro that will re-open and edit it? So far that's what they've been doing.
Bookmarks