Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Referencing CountA - Excel automation object not closing
Hi all. This is my first post here but have gotten valuable info already by
browsing posts. I need to determine if a row is blank. I found the CountA function and it works well, returning 0 if the row is blank. However, I have had trouble in Excel automation in the past by not having valid or properly qualified references to Excel objects. The following code (part of a bigger sub) works fine and does what I need except for one thing, when the procedure is complete, the Excel object won't close. Can anyone tell me where my improper reference may be? (if I comment out the rows with CountA, the Excel object closes) Thanks. Keith With .Sheets(strSheetStoreName) xlApp.ActiveSheet.ResetAllPageBreaks r = 57 Do Until r intLastRow 'outer loop Do Until xlApp.CountA(Rows(r)) = 0 'inner loop If xlApp.CountA(Rows(r)) < 0 Then r = r - 1 Loop 'inner loop If xlApp.WorksheetFunction.CountA(Rows(r)) = 0 Then .HPageBreaks.Add Befo=.Range("a" & r) r = r + 57 Loop 'outer loop End With '.sheets(strsheetstorename) |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VBA COUNTA function and C++ automation | Excel Programming | |||
help !!! please... closing excel application using automation | Excel Programming | |||
Closing Excel Object | Excel Programming | |||
help !!!!.. Excel object not closing | Excel Programming | |||
Using Userform object in Excel via automation from VB 6 | Excel Programming |