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 rows.count property returns 2 even though only 1 row was imported by querytables.add

Environment:
Win7 Home Premium SP1
MS Office Home 2010
Excel 14
VBA for Applications 7.0

Importing a single-line text file with the following

Set qrytable = ActiveSheet.QueryTables.ADD(Connection:="TEXT;" + csvFile, ...)

With qrytable
.Refresh BackgroundQuery:=False
nValues = .ResultRange.Rows.Count
End With

produces nValues=2 from the Rows.Count property. If there's more than one line in the file, Rows.Count is indeed correct.

Anyone else seen this behaviour ?
 
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
Sum, Average, and Count from imported .txt file sdhi Excel Worksheet Functions 2 October 18th 09 03:44 PM
logic that returns a count d_kight Excel Discussion (Misc queries) 8 May 18th 06 12:30 AM
Some worksheet returns NULL for CodeName property. Why? Shigeo Morita Excel Programming 4 December 3rd 04 11:09 PM
Count Property jacqui Excel Programming 2 April 6th 04 11:40 AM


All times are GMT +1. The time now is 02:47 PM.

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

About Us

"It's about Microsoft Excel"