Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default XL2007: Copying worksheets between workbooks

I have some reliable old code that copies worksheets between workbooks
more or less like this:

thisWorkbook.ActiveSheet.Copy after:=thatWorkbook.Worksheets(1)

When I do the copy I want to make sure I get the cell contents,
formatting, validations, any macros in the worksheet's code module,
etc. In other words I want it all.

Sadly I can't reliably count on the Copy method anymore because of the
new workbook formats with their underlying changes in row & column
counts. If thisWorkbook is an XLS and thatWorkbook is an XLSX the
Copy fails.

Obviously it can be a problem copying from an XLSX to an XLS if the
source worksheet contains more rows or columns than the target can
hold and I'm OK with that.

Can somebody suggest an alternative coding technique to replace the
Copy method?

TIA,

josh
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying Worksheets From Different Workbooks using Marco Max2073 Excel Worksheet Functions 4 September 14th 09 04:21 PM
Copying worksheets with formulae between workbooks Paul Excel Discussion (Misc queries) 1 May 14th 08 03:40 PM
Copying Formats between workbooks and worksheets geoff_francis_cox Excel Discussion (Misc queries) 3 July 3rd 05 11:22 PM
Copying Several Workbooks into one Workbook as Worksheets Blue_Crystal New Users to Excel 1 May 26th 05 02:19 PM
Copying worksheets across workbooks Bala Venkat Excel Programming 0 October 5th 04 03:09 PM


All times are GMT +1. The time now is 01:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"