Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copying excel sheets from one excel to another
Message
 
To
24/11/2003 10:03:11
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00852928
Message ID:
00852938
Views:
7
AFAIK, excel does not allow to move sheets between two instances of EXcel.
Try this instead:
oxlsSource = createobject('Excel.application')

oSourceWorkbook = oxlsSource.workbooks.open('e:\source.xls')
oTargetWorkbook = oxlsSource.workbooks.open('e:\target.xls')
oSourceWorkbook.worksheets(1).move(oTargetWorkbook.activesheet)


>Hi,
>I am trying to copy multiple excel worksheets into one target excel file.
>
>All excel files have been created with a copy to xl5 statementand and thus have one worksheet named after the filename.
>
>Here's what I've tried:
>
>oxlsSource = createobject('Excel.application')
>oxlsTarget = createobject('Excel.application')
>
>oSourceWorkbook = oxlsSource.workbooks.open('e:\source.xls')
>oTargetWorkbook = oxlsTarget.workbooks.open('e:\target.xls')
>oSourceWorkbook.worksheets(1).move(oTargetWorkbook.activesheet)
>
>When I do this, excel starts complaining about the properties of move that can't be fetched from the class worksheet.
>
>What am I doing wrong?
>
>TIA,
>Raymond
Previous
Reply
Map
View

Click here to load this message in the networking platform