dstille
01-12-2018, 11:42 AM
I am getting the error 438 on the following line of code. All my company did was switch to a new server computer which runs EXCEL 2016 and ACCESS 2016. I do not understand why this code no longer works.
Thank you in advance.
Dim MySheetPath As String
Dim Xl As Excel.Application
Dim XlBook As Excel.Workbook
Dim XlSheet As Excel.Worksheet
'Tell it location of actual Excel file
MySheetPath = "C:\Users\Public\Documents\WORK ORDERS\Job Number Work Order.xlsx"
'Open Excel and the workbook
Set Xl = CreateObject("Excel.Application")
Set XlBook = GetObject(MySheetPath)
'Make sure excel is visible on the screen
Xl.Visible = True
XlBook.Window.Visible = True -------- Error happens here
Thank you in advance.
Dim MySheetPath As String
Dim Xl As Excel.Application
Dim XlBook As Excel.Workbook
Dim XlSheet As Excel.Worksheet
'Tell it location of actual Excel file
MySheetPath = "C:\Users\Public\Documents\WORK ORDERS\Job Number Work Order.xlsx"
'Open Excel and the workbook
Set Xl = CreateObject("Excel.Application")
Set XlBook = GetObject(MySheetPath)
'Make sure excel is visible on the screen
Xl.Visible = True
XlBook.Window.Visible = True -------- Error happens here