LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA COUNTA function and C++ automation dk Excel Programming 0 September 27th 06 09:02 PM
help !!! please... closing excel application using automation No Name Excel Programming 3 January 30th 04 03:58 PM
Closing Excel Object Mark Excel Programming 2 January 16th 04 03:44 PM
help !!!!.. Excel object not closing No Name Excel Programming 0 January 6th 04 11:49 AM
Using Userform object in Excel via automation from VB 6 Howard Kaikow Excel Programming 10 December 5th 03 02:58 PM


All times are GMT +1. The time now is 09:12 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"