![]() |
how to check if a cell is populated or not?
If IsEmpty(xbook.Application.Cells(I, 1)) Then
' do stuff... End If |
how to check if a cell is populated or not?
Hello there
I am using a nested loop to read from an Excel workbook. When I reach the first unused Cell, an "Object reference not set to an instance of an object" error is generated. How do I check if the cell if used or not? I tried: xbook.Application.Cells(I, 1).value().ToString.Length < 0 xbook.Application.Cells(i, 1).value() = Nothing and both did not work. Any ideas? Regards Sameh |
how to check if a cell is populated or not?
Hi
try If IsEmpty(xbook.worksheets("sheet1").Cells(I, 1)) Then ' do stuff... End If -- Regards Frank Kabel Frankfurt, Germany Sameh Ahmed wrote: Hello there I am using a nested loop to read from an Excel workbook. When I reach the first unused Cell, an "Object reference not set to an instance of an object" error is generated. How do I check if the cell if used or not? I tried: xbook.Application.Cells(I, 1).value().ToString.Length < 0 xbook.Application.Cells(i, 1).value() = Nothing and both did not work. Any ideas? Regards Sameh |
how to check if a cell is populated or not?
I am working on .net visual basic
i added Imports Microsoft.Office.Interop.Excel but i still give the error; Name 'isempty' is not declared. any ideas? "Francesco Sblendorio" wrote in message ... If IsEmpty(xbook.Application.Cells(I, 1)) Then ' do stuff... End If |
All times are GMT +1. The time now is 05:05 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com