Hi all,
I've got an excel file which end users open as a template, then once they've put header information in, gets saved as an individual file.
After this has occurred, I've got a userform which is called from another workbook (the reason for this being that the form has bitmaps in it, and pushes the file size up by 600kb, so by calling it remotely, I'm saving a significant amount of disk space over time).
So, for this to work, Excel has to open secondary workbook in the background. I don't mind this, but after the user has selected the information from the form, and it's gone through its Unload Me process, the secondary workbook is still open.
If I add a activeworkbook.close command, Excel wants to close the ongoing (primary) workbook, as it's the one that's currently active.
Is there a way I can specify the workbook to be closed? The secondary workbook I'd like to close will always have the same filename, but by the time the Userform is called, the primary workbook will have its own, unique name. I also can't be 100% certain that end users won't have any other .xls files open, so I'd like to be as specific as possible when telling it to close one.
Any pointers would be greatly appreciated, many thanks in advance!
I've got an excel file which end users open as a template, then once they've put header information in, gets saved as an individual file.
After this has occurred, I've got a userform which is called from another workbook (the reason for this being that the form has bitmaps in it, and pushes the file size up by 600kb, so by calling it remotely, I'm saving a significant amount of disk space over time).
So, for this to work, Excel has to open secondary workbook in the background. I don't mind this, but after the user has selected the information from the form, and it's gone through its Unload Me process, the secondary workbook is still open.
If I add a activeworkbook.close command, Excel wants to close the ongoing (primary) workbook, as it's the one that's currently active.
Is there a way I can specify the workbook to be closed? The secondary workbook I'd like to close will always have the same filename, but by the time the Userform is called, the primary workbook will have its own, unique name. I also can't be 100% certain that end users won't have any other .xls files open, so I'd like to be as specific as possible when telling it to close one.
Any pointers would be greatly appreciated, many thanks in advance!
