Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Save method in Excel not working

Status
Not open for further replies.

Mack2

Instructor
Mar 12, 2003
336
US
I am opening an excel workbook with a macro. The opened workbook runs a "delete all code" procedure. That part is working great. But if I save the changes using the code below, when I reopen it, I get "do you wish to enable macros dialog box" (even though there is not any code).
If I close the workbook manually. When I reopen, I do not get the dialog box. Why is the save method causing this trouble? Thanks

Workbooks.Open Filename:="c:\temp\Book1.xls"
Workbooks("book1").Close SaveChanges:=True
 
I had this problem on a project I was working on, it turned out to be that the module was still there even though the VBA Code had gone, I think I got round it by copying the relevant worksheets to a new (blank) workbook, then saving the new workbook.

Hope this helps

Barney
 
Thanks for the input. Sorry you had the problem, but I am glad it is not just me. I ended up copying the code in the module to the this workbook module. So now I am not using any modules. This is a very strange issue. I wonder if it is a bug.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top