Close method of object workbooks (1 Viewer)

D

DavidGilmour

Guest
On Excel, I am attempting to use a macro which will first ask a user if they wish to save a file, then close it for them.
I am fine with the messageboxes to do this, but once the code "ActiveWorkbook.close" is run, a runtime error (1004) appears.
I have tried to use the lines "ThisWorkbook.close" and "filename = "XXXXX.xls".close", but they all bring up the same error. WHY??? There is no probs manually closing the file, but I want to associate the macro with a form button.
Can you tell me what is going down here??
 

Users who are viewing this thread

Top Bottom