Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to know an Excel spreadsheet is empty
Message
From
07/12/2002 17:49:15
 
 
To
07/12/2002 17:40:17
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00730656
Message ID:
00730664
Views:
11
Let me know if I can be of any help.


>David,
>
>Thank you very much.
>I think that is all I need.
>
>I'm finishing testing the importing of text files -the most difficult thing was to create an interface to allow users to map fixed lenght files- , Excel is next, then DBFs, then XML. So far so good, problem is, I need to deliver this on Tuesday morning.
>
>
>>lcFile = "MyWorkBook.xls"
>>oExcel = CreateObject("Excel.Application")
>>oWorkBook = oExcel.WorkBooks.Open(lcFile)
>>oSheet = oWorkBook.Sheets(1)
>>lcUsedRange = oSheet.UsedRange.Location
>>If lcUsedRange == "$A$1"
>> * Sheet is Empty
>>EndIf
>>*- End of Snippet -*
>>
>>Maria, this is quick code. I am doing this from memory. If you would like some real code let me know and I will fish through some stuff. If you want to check cell by cell:
>>
>>oSheet.Cells(nRow,nCol).Value && True value of cell (.Null. is possible)
>>oSheet.Cells(nRow,nCol).Text && value of cell returned as Character
>>
>>Let me know if you want me to fill in the blanks with specifics (named files, sheets, etc.)
>>
>>- David -
Previous
Reply
Map
View

Click here to load this message in the networking platform