katto Posted February 18 Share Posted February 18 I have this script and the LastColumn and LastRow lines do not work. Any suggestions? Thank you CODE --> vbscript Set objExcel = CreateObject("Excel.Application") strExcelPath="C:\TMP\TEST.XLSX" objExcel.Workbooks.Open strExcelPath objExcel.Visible = True Set objSheet = objExcel.ActiveWorkbook.Worksheets(2) With objExcel Set objSheet = objExcel.ActiveWorkbook.Worksheets(2) LastColumn = objSheet.Cells(1, .Columns.Count).End(xlToRight).Column LastRow = objSheet.Cells(.Rows.Count, 4).End(xlUp).Row End With Link to comment Share on other sites More sharing options...
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!Register a new account
Already have an account? Sign in here.Sign In Now