HI,
I have the code below and it was working fine (Open excel file from outlook) but suddenly getting this error:
Compile Error:
Method or data member not found (on the line below)
Complete code:
I have the code below and it was working fine (Open excel file from outlook) but suddenly getting this error:
Compile Error:
Method or data member not found (on the line below)
Code:
Set xWb = xExcelApp.Workbooks.Open(xExcelFile)
Complete code:
Code:
Public Sub OpenVendorChartofAcounts() Dim xExcelFile As String
Dim xExcelApp As Excel.Application
Dim xWb As Excel.Workbook
Dim xWs As Excel.Worksheet
Dim xExcelRange As Excel.Range
xExcelFile = "\\mtlnas01\share\Accountant Files\AP Team\Jose\NCL_XLSM\CHART OF ACCOUNTS.xlsm"
Set xExcelApp = CreateObject("Excel.Application")
Set xWb = xExcelApp.Workbooks.Open(xExcelFile)
Set xWs = xWb.Sheets(1)
xWs.Activate
Set xExcelRange = xWs.Range("A1")
xExcelRange.Activate
xExcelApp.Visible = True
xWb.Windows(1).WindowState = xlMaximized
End Sub