var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Open Excel from Access
Can anyone tell me what the VB commands are for opening a specific Excel file via an Access command button
first add a reference of Excel. then use this code on the click event of the command button
Dim xlw As Excel.Workbook
Set xlw = GetObject(strFile)
xlw.Application.Visible = True
Thanks for the reply.
This seems to fire up Excel OK but fails to load the required workbook, any idea way?
This is my code
DoCmd.OpenQuery "WeeklyCreditControl_qry1", acViewNormal
Dim xls As Excel.Workbook
Set xls = GetObject("H:\RISTATS\Credit_Control\1096\credit control test.xls")
xls.Application.Visible = True
Why not add a 'FollowHyperlink' right below your Do.Cmd?
This should do the trick:
FollowHyperlink "H:\RISTATS\Credit_Control\1096\credit control test.xls"
I had a lot trouble trying to open Excel for a specific file and I think part of my trouble was using Access 95 and the code being posted up would not work for Access 95
However, I found the easiest way to solve the problem (at least for me) was to create a shortcut and then have a macro do RunApp for a .bat file that ran the shortcut.
Thanks guy's for you suggestion, In the end I tried these suggestions and the Shell function but the FollowHyperLink idea seemed to work the best.