Mike Lewis
Programmer
I have some Visual FoxPro code that uses Automation to create an Excel workbook, based on a template. It's the usual sort of stuff:
The problem is that the template contains an auto-run macro, that is, a macro that is designed to run each time a user opens the workbook. The macro uses Excel's Workbook_Open(), which fires when the workbook is opened.
I want the macro to run when a user opens the workbook (in Excel), but it's also running when the above VFP code is executed, which I don't want.
Does anyone know of a way to suppress the auto-start macro in these circumstances?
Thanks in advance,
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
Visual FoxPro tips, advice, training, consultancy
Custom software for your business
Code:
loXL = CreateObject("excel.application")
loWB = loXL.Workbooks.Add("c:\stuff\MyTemplate.XLS")
The problem is that the template contains an auto-run macro, that is, a macro that is designed to run each time a user opens the workbook. The macro uses Excel's Workbook_Open(), which fires when the workbook is opened.
I want the macro to run when a user opens the workbook (in Excel), but it's also running when the above VFP code is executed, which I don't want.
Does anyone know of a way to suppress the auto-start macro in these circumstances?
Thanks in advance,
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
Visual FoxPro tips, advice, training, consultancy
Custom software for your business