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: 1
Default Identifying Blank Excel Sheet through .NET code


Hi All,

I am reading an excel sheet using OLEDB connection , now what I want t
know is how can I make out that the sheet whether the sheet is blank o
not ??

Here is my code
////////////////////////////////////////////////////////////////////////////////////

Dim connString As [String] = "Provider=Microsoft.Jet.OLEDB.4.0;"
"Data Source=" + excelFile + ";Extended Properties=Excel 8.0;"

objConn = New OleDb.OleDbConnection(connString)

Dim commandTxt As String = "Select * from [Sheet1$]"

command = New System.Data.OleDb.OleDbDataAdapter(commandTxt, objConn)

objConn.Open()
DS = New DataSet
command.Fill(DS)
////////////////////////////////////////////////////////////////////////////////


I tried this

Dim i as integer
i = DS.Tables(0).Rows.Count

if i 1 then
end if

But the results were not as excepted and did not form any pattern
using which I could conclude that this condition gives me the exac
result


Thanx & Regards,
Abh

--
Abhi Kuma
-----------------------------------------------------------------------
Abhi Kumar's Profile: http://www.msusenet.com/member.php?userid=502
View this thread: http://www.msusenet.com/t-187104747

 
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
Identifying non-returning formula (blank Cell) Vibeke Excel Worksheet Functions 9 September 4th 09 09:29 AM
Help Identifying code statement Ayo Excel Discussion (Misc queries) 1 November 29th 07 03:50 AM
Identifying first non blank cell in 3 different columns belvy123 Excel Discussion (Misc queries) 5 February 21st 07 06:36 AM
Personally Identifying information in Excel Sheet Fonz Excel Worksheet Functions 1 June 12th 06 04:34 PM
Identifying blank rows Raj[_8_] Excel Programming 5 February 25th 04 10:59 AM


All times are GMT +1. The time now is 04:18 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"