ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   While reading excel file i am getting null values (https://www.excelbanter.com/excel-programming/295922-while-reading-excel-file-i-am-getting-null-values.html)

Aruna Tennakoon

While reading excel file i am getting null values
 
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



Patrick Molloy[_14_]

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


.



All times are GMT +1. The time now is 06:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com