View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Hide all menubars even 'Worksheet Menu Bar'

Hi Filips

Try this in Access

Sub test()
Dim bar
On Error Resume Next
Set xl = GetObject(, "Excel.Application")
If xl Is Nothing Then
Set xl = GetObject("", "Excel.Application")
xl.workbooks.Open "c:\Data\test3.xls"
xl.UserControl = True
xl.Visible = True
For Each bar In xl.CommandBars
bar.Enabled = False
Next
End If
AppActivate "Microsoft Excel"
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Filips Benoit" wrote in message ...
Dear All,

How can I hide all menubars by code when opening excel from Access.

Thanks,

Filip