Hi all,
I have certain spreadsheets that are created programatically through VFP, which are originally created from basic templates which contain macros, which all the new spreadsheets inherit. These macros also play a part in populating the cells.
Now I face a unique problem. After creating/opening an excel file through VFP, and creating a new sheet in a spreadsheet using a macro called CreateSheet (below), I need to save,close and reopen the file, in order for the other macros to fire. Otherwise they do not fire!
This process can take upto 30 seconds extra!
My code, below
oExcel=GetObject(,"Excel.Application")
WITH oexcel
.Run("Macrofile.xls!CreateSheet")
.Activeworkbook.save
.Activeworkbook.close
.workbooks.open('c:\devstudio\panorama\'+lcgang+'.xls')
.Run("Macrofile.XLS!NewSheetName")
DO Prgfillsheet
ENDWITH
Thanks in advance,
Regards,
Steve