View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Patrick Molloy[_14_] Patrick Molloy[_14_] is offline
external usenet poster
 
Posts: 2
Default While reading excel file i am getting null values

Why not set a ref to the excel obj library the just open
the workbook ? That way you can manipulate the worksheet
object etc etc

dim xl as excel.application
dim wb as excel.workbook
dim ws as excel.worksheet
dim cell as excel.range

set xl = new excel.application
set wb = xl.workbooks.open(ThisWorkbook)
set ws = wb.activesheet

....do something with the sheet..
for each cell in ws.Range("C3:K12")
...blah
Next
...
...
wb.close false ' close the book without saving
xl.quit
set ws = nothing
set wb = nothing
set cell = nothing
set xl = nothing


HTH

Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
Hi guys,

I am writing a program to import data

from a excel file
using a MS Visual Basic 6.0.
I am using "Microsoft.Jet.OLEDB.4.0" as the provider.

While I am reading the
excel file I am getting null values for some fields

which is not null in the
excel file. Can any one help me to resolve this please.

Thanks,
-Aruna


.