Hi,
I have a spreadsheet with a sheet that's linked to a query in my database
with automatic refresh on open. I also have a switchboard in the database
item that starts the following code to open the spreadsheet:
Function OpenExcelFile(strPathToFile As String)
Dim objXL As Object
On Error Resume Next
'Set objXL = GetObject(, "Excel.Application")
Set objXL = GetObject(strPathToFile)
objXL.Application.Visible = True
objXL.Parent.Windows(1).Visible = True
End Function
It opens OK but the sheet is blank and XL is frozen until I go back to
Access, do nothing there, then go back to XL; then the spreadsheet
refreshes
its data.
Of course I want the spreadsheet to open and refresh without the users
having to switch back to Access then to XL.
What's wrong or missing with the code above?
Thanks for help,
--
Fjordur