Excel Macros Disappear

mdmre

New Member
I have a number of programs that produce an Excel spreadsheet. I use something like what is included below to create the spreadsheets. After execution, the spreadsheet is displayed and all of my macros in Excel are not there. In the addins screen, the macros all show with a check in the box. If I open up VB to edit the macros, it shows nothing but the current worksheet, no macros. If I uncheck the macro in the addin screen, then check it, it will load the macro. Does anyone know what is causing Excel to load without the macros or how I can cause Excel to actually load the macros?

CREATE "Excel.Application" chExcelApplication.
chExcelApplication:Visible = FALSE.
chWorkbook = chExcelApplication:Workbooks:Add().
chWorksheet = chExcelApplication:Sheets:Item(1).
chWorksheet:Range("A1"):Value = "Report ID:".
chWorksheet:Range("E1"):Value = "Customer".
...
chWorksheet:Range("A:AH"):EntireColumn:AutoFit.
chExcelApplication:Visible = true.
chWorkbook:SaveAs("C:\Symwork\cs00058",,,,,,,,TRUE) no-error.
RELEASE OBJECT chExcelApplication.
RELEASE OBJECT chworkbook.
RELEASE OBJECT chWorksheet


Any recommendations would be greatly appreciated.
Does this happen to anyone else?

Thanks.
 

sphipp

Member
What I normally do is to have a blank Excel Spreadsheet that contains all the macros that I need, then I copy that to my new name, open the new spreadsheet, make the changes and save it. That way, I don't have to worry about messing about with macros.

Do you have macros that are particular to the new spreadsheet? I.e. do you generate the macros when you create the spreadsheet?
 

mdmre

New Member
I do have macros that already exist and are to be used with the newly created spreadsheet. I don't generate the macros, they already exist as excel add-ins. This happens with any spreadsheet created with progress.
I have a number of them that need to use existing macros.
 
Top