Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Active area in excel spreadsheet
Message
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00704098
Message ID:
00704113
Views:
24
>Hello, This routine tells excel to open up an html file, then save it as a dbase file. In order for this to happen, vfp must tell excel to select the part of the spreadsheet that has data in it, else excel might only save a single row when it writes the dbf file. I am stuck on the part where vfp must tell excel to select the active area. Can anyone help?
>thanks
>Steve
>o = CREATEOBJECT('excel.application')
>eFile = "c:\test.htm"
>o.Application.Workbooks.Open(eFile)
>o.Visible= .T.
>#define xlLastCell = 11
>o.Application.Range("A1:B1").Select
>
>&&&& <--------- the problem line is the next one
>o.Application. Range("a1", ActiveCell.SpecialCell(xlLastCell)).Select
>&&&& <--this last line says "Active Cell not found"
>
>** 39 means save as a Dbase file.
>o.Application.ActiveWorkBook.SaveAs(eFile,39)

You can use CurrentRegion or UsedRange properties:

o.Application.Range("A1").CurrentRegion.Select
o.Application.ActiveSheet.UsedRange.Select
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform