ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Write VBA code into a sheet module using VBA (https://www.excelbanter.com/excel-programming/288552-write-vba-code-into-sheet-module-using-vba.html)

quartz

Write VBA code into a sheet module using VBA
 
Hello, I posted some questions regarding this issue earlier, then posted back because I thought I had solved my issues, but my code is still unstable. Please help.

I have a program that performs the following:

1. Create a new "Report" sheet on user demand (the new "Report" sheet replaces the existing "Report" sheet)
€” This I have and it functions fine;

2. Write a small VBA procedure into the sheet module of the "Report" sheet everytime it is rebuilt using VBA.

My step "2" once it is completed, sometimes causes my Excel XP (Win 2000) to generate a fatal error and Excel closes. I placed a save after the procedure so the file is saved before the crash and when I reopen the file, everything is as it should be, but obviously I don't want my app to crash "occasionally" (like every third time or so).

Could someone please supply me with some example code on how to do this? I am not posting my code since it obviously is no good, but if you want it I can post it.

Thanks in advance for your assistance.




All times are GMT +1. The time now is 01:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com