Excel Copying whole Sheets from mulitple workbooks, to a target workbook

A

Allen

I'm trying to copy multiple worksheets (in their entirety, formatting and
all), from multiple workbooks, to a single
target workbook. This can be done from within the Excel user interface, but
I can't seem to find a way to do this programatically via the COM interface.
Any clues????

All responses are greatly appreciated.
 
T

Tom Ogilvy

Shouldn't be any different. Objects/methods/properties are the same
particularly if you are using VB.
 
A

Allen

Hello Ron,

I see your code is VBA... I'm using VB6. THe follwoing code did the trick:

Call XLApp1.Workbooks(1).Sheets(1).Copy(XLApp1.Workbooks(2).Sheets(1))

I originally was trying to do this between to Excel apps.... which failed.
THanks for the insight!!!

Allen Segall
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top