This my working piece of code in VBA
All works fine. But in vs2013 error occurredCode:Dim objExcel As Object Dim objCell As Object Dim objWorksheet As Object Set objExcel = Excel.Application ' GetObject(, "Excel.Application") Set objWorksheet = objExcel.ActiveWindow.ActiveSheet Set objCell = objExcel.ActiveCell If objExcel.CountA(objWorksheet.Rows(1).EntireRow) <> 0 Then objExcel.ActiveWindow.SmallScroll Down:=1 End If
System.Runtime.InteropServices.COMException was unhandled
my code is:
Code:Dim objExcel As Object Dim objCell As Object Dim objWorksheet As Object objExcel = GetObject(, "Excel.Application") objWorksheet = objExcel.ActiveWindow.ActiveSheet objCell = objExcel.ActiveCell If objExcel.CountA(objCell.Rows.EntireRow) <> 0 Then '<========= ERROR LINE objExcel.ActiveWindow.SmallScroll(Down:=1) End If


Reply With Quote
