MadsLeDanois
New Member
- Joined
- Dec 18, 2006
- Messages
- 3
I have a very strange problem with Excel.
In Excel VBA I use ThisWorkBook to run some initial commands at start up for example:
Private Sub Workbook_Open()
With Application
.ScreenUpdating = False
.DisplayFormulaBar = False
.DisplayStatusBar = False
.ScreenUpdating = True
.WindowState = xlNormal
.Width = 865
.Height = 740
.CommandBars("Drawing").Visible = False
End With
End Sub
If I open the Excel workbook directly it works perfect and run these commands, but if I open it from a vbscript with these commands:
Set aa=createobject("Excel.Application")
aa.Workbooks.Open "C:\Test.xlsm"
aa.visible = true
Set aa = nothing
It will not run the commands in ThisWorkBook at startup.
It works fine with Windows XP, 7 and even 8 together with Office Excel 2010, but not on Windows 8.1 (not sure if this matters).
Do anybody know a workaround or a setting of some kind which can cause this?
Kind regards
Mads
In Excel VBA I use ThisWorkBook to run some initial commands at start up for example:
Private Sub Workbook_Open()
With Application
.ScreenUpdating = False
.DisplayFormulaBar = False
.DisplayStatusBar = False
.ScreenUpdating = True
.WindowState = xlNormal
.Width = 865
.Height = 740
.CommandBars("Drawing").Visible = False
End With
End Sub
If I open the Excel workbook directly it works perfect and run these commands, but if I open it from a vbscript with these commands:
Set aa=createobject("Excel.Application")
aa.Workbooks.Open "C:\Test.xlsm"
aa.visible = true
Set aa = nothing
It will not run the commands in ThisWorkBook at startup.
It works fine with Windows XP, 7 and even 8 together with Office Excel 2010, but not on Windows 8.1 (not sure if this matters).
Do anybody know a workaround or a setting of some kind which can cause this?
Kind regards
Mads