Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Importing a spreadsheet-like HTML file
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01155024
Message ID:
01155532
Views:
23
Hi again BB

It's your Wednesday afternoon virus now :-)

Just trying to wade my way through the Basic code from my recorded macro.
loExcel = CREATEOBJECT([Excel.Application])
Wait WINDOW "Opening HTML File ..." NOWAIT NOCLEAR 
With loExcel
  .Workbooks.Open( "R:\OPDATA\Essex\SM_Coaches\APR06\sm coaches disk.htm")
  Wait WINDOW "Saving as Excel Spreadsheet ..." NOWAIT NOCLEAR 
  .ActiveWorkBook.SaveAs("Test.XLS", xlNormal)
  Wait CLEAR 
* For Now>	  With .ActiveSheet 
    .Rows("1:4").Select
    .selection.
* For Now>	    .Selection.Delete Shift=xlUp
    .Selection.FormatConditions.Delete
    .Columns("C:C").Select
* For Now>	    .Selection.Delete Shift=xlToLeft
    .Selection.FormatConditions.Delete
In the above lines (note I've commented out the With .activesheet line - so now I'm getting further).
I can't seem to get Intellisense to react to my code and so am flying pretty blind.

When I issue the ".ActiveWorkBook.SaveAs("Test.XLS", xlNormal)" I get an "OLE dispatch error - cannot access Test.xls"

When I issue ".Selection.Delete Shift=xlToLeft" I get "Syntax error" - obviously, as I don't know the translation.

Same with ".Selection.Insert Shift=xlToRight"

I wonder if you could put me right on the syntax (beware, I'll probably be back for more once I've got thses simpler commands out of the way).

BTW, all these actions are taking place "in the dark" so to speak, as no visible file is produced - no spreadsheet, either in HTML or XLS form.

Thanks

Terry
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform