Is there any way to open an Excelsheet in code without enabeling the macro's?
Dim WB as WorkBook
Set WB = Application.Workbooks.Open("filename.xls")
Printable View
Is there any way to open an Excelsheet in code without enabeling the macro's?
Dim WB as WorkBook
Set WB = Application.Workbooks.Open("filename.xls")
take a look at the automationsecurity property
should be something like
VB Code:
Application.AutomationSecurity = msoAutomationSecurityForceDisable
Well you could also set the security to "very high"
True, but if he does that, I think he won't be able to run the macro that opens his new workbook...
That is the problem indeed.
msoAutomationSecurityForceDisable is a 2003 thing
And I ain't got 2003.
By the way, I don't need the macro's in the sheet.
The problem is, if I open the sheet witch contains macro's, the macro from which I open the sheet stops immediately after opening the sheet.
Got it?
If you don't need the macro at all, why don't you just delete it.Quote:
Originally Posted by HWijngaarD
And if you need it for further uses, place them in a module.
I don't think you can disable macro for only one sheet, you disbale it for the whole workbook. So this is why you got this problem:Quote:
Originally Posted by HWijngaarD
IF all of these are Event Macro, like Worksheet_Change(ByVal Target As Range), etc.
The you can disable them by calling "Application.EnableEvents = False"
Make sure you turn events back on when your done.