I have this code bits that work in VBA and I need the VBScript version.
All I am trying to do, is get the latest column number of row 1 and the last row of column 15
Last two lines do not work.
Any ideas?
Dim objExcel, strExcelPath, objSheet
strExcelPath = "C:\tmp\test.xlsx"
Set objExcel = CreateObject("Excel.Application")
objExcel.WorkBooks.Open strExcelPath
Set objSheet = objExcel.ActiveWorkbook.Worksheets(1)
sh = "Journal"
LastColumn=objSheet.Cells(1, .Columns.Count).End(xlToLeft).Column
Lastrow = objExcel.Sheets(sh).Cells(.Columns.Count, 15).End(xlToRight).Column
All I am trying to do, is get the latest column number of row 1 and the last row of column 15
Last two lines do not work.
Any ideas?
Dim objExcel, strExcelPath, objSheet
strExcelPath = "C:\tmp\test.xlsx"
Set objExcel = CreateObject("Excel.Application")
objExcel.WorkBooks.Open strExcelPath
Set objSheet = objExcel.ActiveWorkbook.Worksheets(1)
sh = "Journal"
LastColumn=objSheet.Cells(1, .Columns.Count).End(xlToLeft).Column
Lastrow = objExcel.Sheets(sh).Cells(.Columns.Count, 15).End(xlToRight).Column