General information
Category:
Object Oriented Programming
>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only