Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy a sheet in an Excel workbook
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00227990
Message ID:
00229924
Views:
40
Bruce,

I had tried that before with a single space and with an empty string and the result is "OLE IDispatch exception code 1004 from Microsoft Excel: Unable to get the Copy property of the worksheet class." What I did not try until just now is:

oleApp.Worksheets('sheet1').copy(.null.,oleApp.Worksheets('sheet2'))

THIS WORKS!! :)

Thanks to you and Perry for giving me different approaches to try.

Mark

>>Perry,
>>
>>I am not sure what I could be doing wrong. I am doing the following:
>>
>>oleApp = CREATEOBJECT("Excel.Application")
>>oleApp.Visible=.t.
>>oleApp.Workbooks.open(curdir()+"crosstab.xls")
>>oleApp.Worksheets('sheet1').copy(,oleApp.Worksheets('sheet2'))
>>
>>The result of the last command is a syntax error.
>>
>>Are you adding any spaces or anything else that I may be missing?
>
>Just a WAG, but once or twice I've gotten similar parameter problems to work by passing it something - if it's char, you can try a space, something like that...
>
>oleApp.Worksheets('sheet1').copy(' ',oleApp.Worksheets('sheet2'))
Mark Johns
Previous
Reply
Map
View

Click here to load this message in the networking platform