I have an issue with a VBA program I wrote (that is the first problem) in Excel. The program is saved in its own workbook (call it progbook). The program opens two other Excel files. One file contains data (call it databook) and the other file contains summary tables and charts (call it chartbook). The program reads data from databook and summarizes the data in chartbook. When I close databook, I don't want to save any changes that might have been made so I use
workbooks(databook).close false
When I close chartbook I do want to save changes so I use
workbooks(chartbook).close true
The program seems to close databook fine but I get an error trying to save chartbook. The error I get is a 1004 error with a description of "document not saved". Using the debug option to go to the editor, the close method line is highlighted. Any attempt to change anything in the code results in an error of something like "can't load dll" and the changes are ignored. I have to manually close the workbook chartbook and then I can make changes in the code.
The code is lengthy because there is a lot of data that is processed, tables made, and charts updated. The code is also a mess because management's vision of the final report continues to evolve. My question at this point is what can cause Excel not to save a workbook? I have tried
workbooks(chartbook).save
I have tried
workbooks(chartbook).saveas [complete path]
No luck with any of these. I seem to have tilted the jupiter rings out of alignment and I don't know how I did it.
Thanks for any help.
Mark
workbooks(databook).close false
When I close chartbook I do want to save changes so I use
workbooks(chartbook).close true
The program seems to close databook fine but I get an error trying to save chartbook. The error I get is a 1004 error with a description of "document not saved". Using the debug option to go to the editor, the close method line is highlighted. Any attempt to change anything in the code results in an error of something like "can't load dll" and the changes are ignored. I have to manually close the workbook chartbook and then I can make changes in the code.
The code is lengthy because there is a lot of data that is processed, tables made, and charts updated. The code is also a mess because management's vision of the final report continues to evolve. My question at this point is what can cause Excel not to save a workbook? I have tried
workbooks(chartbook).save
I have tried
workbooks(chartbook).saveas [complete path]
No luck with any of these. I seem to have tilted the jupiter rings out of alignment and I don't know how I did it.
Thanks for any help.
Mark