Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Moving Worksheets from one book to another
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Moving Worksheets from one book to another
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01335195
Message ID:
01335195
Views:
49
I have used the following code from "Microsoft Office Automation with Visual Foxpro" by Tamar Granor but I can't it to work
loTempWorkBook = CREATEOBJECT("Excel.Application")
loTempWorkBook.Workbooks.Open("C:\Dev\Questback\Data\Invicta\Repairs(REP)\"+DTOS(DATE()-1)+"RSLSummary.xls")
loTempWorkBook.Visible = .T.
loMTWorkBook = CREATEOBJECT("Excel.Application")
loMTWorkBook.Workbooks.Open("C:\Dev\Questback\Data\Invicta\Repairs(REP)\"+DTOS(DATE()-1)+"RepairURL.xls")
loMTWorkBook.Visible = .T.

loTempWorkBook.Worksheets(1).Move(loMTWorkBook.ActiveSheet)    && Error on this line 

loMTWorkBook.SaveAs = ("C:\Dev\Questback\Data\Invicta\Repairs(REP)\"+DTOS(DATE()-1)+"RepairURL.xls")
RELEASE loTempWorkBook
Error Message:

OLE IDespatch exception code 0 from Microsoft Office Excel:
Unable to get the move property of the Worksheet class

Is there something missing in the move syntax? Can any one help? Is there another way to do this?
Regards

Tony Millard
Next
Reply
Map
View

Click here to load this message in the networking platform