Hi, when opening an excel spreadsheet from a link on a form the spreadsheet opens in a minimised state. Adding this line of code fixes the problem and opens the spreadsheet with focus.
However, when I close the spreadsheet there's an error message behind it - 424 - Object Expected. Here's the full code:
Any help much appreciated
Thanks
Code:
Set xlApp.UserControl = True
Code:
Private Sub txtWorksPriceLink_Click()
Dim xlApp As Object
Dim xlBook As Object
Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Open("Z:\" & Me.txtProjID & "\WorksPrice.xlsx")
xlApp.Visible = True
Set xlApp.UserControl = True
Set xlApp = Nothing
End Sub
Thanks