MountainVogu
07-04-2006, 04:30 PM
Hi
Sorry guys had a good trawl and cant find anything relevent.
The sub below shows the relevent parts of creating a new session of excel and adding a workbook to that session.
Sub x()
Dim xlApp As Excel.Application
Dim xlWbook As Excel.Workbook
Set xlApp = New Excel.Application
xlApp.Application.WindowState = xlNormal
xlApp.Workbooks.Add 'use this line for testing
'ignore
'Set xlWbook = xlApp.Workbooks.Open(ThisWorkbook.Path & "\" & _
'Main.SessionTaskParameters(1, 4), False, True, , , , , , , , False)
xlApp.Application.WindowState = xlMaximized
' ignore during testing
' If DefaultWbook = False Then
' xlApp.Run (xlApp.ActiveWorkbook.Name & "!" & Main.SessionTaskParameters(1, 5))
' End If
Set xlApp = Nothing
End Sub
My problem, no commandbars are visible. I can display and hide the formulabar but setting the commandbars visible and enabled properties does nothing.
I feel sure its a simple thing I'm missing.
Any ideas and many thanks in anticipation
Mv
PS.
Funnily enough I want restricted functionally but I want to be able to add my own menu to the worksheet commandbars. But when I cant even to to get it visible its a little pointless.
Just to clarify this is not a question about adding custom menus to existing excel menus.
Sorry guys had a good trawl and cant find anything relevent.
The sub below shows the relevent parts of creating a new session of excel and adding a workbook to that session.
Sub x()
Dim xlApp As Excel.Application
Dim xlWbook As Excel.Workbook
Set xlApp = New Excel.Application
xlApp.Application.WindowState = xlNormal
xlApp.Workbooks.Add 'use this line for testing
'ignore
'Set xlWbook = xlApp.Workbooks.Open(ThisWorkbook.Path & "\" & _
'Main.SessionTaskParameters(1, 4), False, True, , , , , , , , False)
xlApp.Application.WindowState = xlMaximized
' ignore during testing
' If DefaultWbook = False Then
' xlApp.Run (xlApp.ActiveWorkbook.Name & "!" & Main.SessionTaskParameters(1, 5))
' End If
Set xlApp = Nothing
End Sub
My problem, no commandbars are visible. I can display and hide the formulabar but setting the commandbars visible and enabled properties does nothing.
I feel sure its a simple thing I'm missing.
Any ideas and many thanks in anticipation
Mv
PS.
Funnily enough I want restricted functionally but I want to be able to add my own menu to the worksheet commandbars. But when I cant even to to get it visible its a little pointless.
Just to clarify this is not a question about adding custom menus to existing excel menus.