Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Works in 2000, not in 2007

Hi All.....
I have a program that opens a second file and then copies a sheet out of it
into the main program. It was written in XL2000 and works fine. When I try
to run it in XL2007 it stops on the following line:

ActiveSheet.Copy after:=ThiisWorkbook.sheets(1)

And gives the following error message:

"Excel cannot insert the sheets into the destination workbook, because it
contains fewer rows and columns than the source workbook. To move or copy
the data to the destination workbook, you can select the data, and then use
the Copy and paste commands to insert it into the sheets of another workbook."

The sheet I'm trying to copy is only 450 rows and about 15 columns, and
copies fine in XL2000.

Any ideas would be appreciated.

Vaya con Dios,
Chuck CABGx3


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default Works in 2000, not in 2007

Try inserting a blank sheet first and then pasting your data into the empty
sheet - two steps rather than just the one.

"CLR" wrote:

Hi All.....
I have a program that opens a second file and then copies a sheet out of it
into the main program. It was written in XL2000 and works fine. When I try
to run it in XL2007 it stops on the following line:

ActiveSheet.Copy after:=ThiisWorkbook.sheets(1)

And gives the following error message:

"Excel cannot insert the sheets into the destination workbook, because it
contains fewer rows and columns than the source workbook. To move or copy
the data to the destination workbook, you can select the data, and then use
the Copy and paste commands to insert it into the sheets of another workbook."

The sheet I'm trying to copy is only 450 rows and about 15 columns, and
copies fine in XL2000.

Any ideas would be appreciated.

Vaya con Dios,
Chuck CABGx3


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Works in 2000, not in 2007

I'm just guessing that your ActiveSheet is in Excel 2000 form (max rows
65536, max cols 256) and ThisWorkbook is in Excel 2007 form with more rows
and columns (I don't know the max of the top of my head.

I'm thinking that if the workbook with your active sheet in it was saved as
a .xlsx file and then you tried to do this, it would work.

Does this code need to be used in both 2000 and 2007?
--
HTH,

Barb Reinhardt



"CLR" wrote:

Hi All.....
I have a program that opens a second file and then copies a sheet out of it
into the main program. It was written in XL2000 and works fine. When I try
to run it in XL2007 it stops on the following line:

ActiveSheet.Copy after:=ThiisWorkbook.sheets(1)

And gives the following error message:

"Excel cannot insert the sheets into the destination workbook, because it
contains fewer rows and columns than the source workbook. To move or copy
the data to the destination workbook, you can select the data, and then use
the Copy and paste commands to insert it into the sheets of another workbook."

The sheet I'm trying to copy is only 450 rows and about 15 columns, and
copies fine in XL2000.

Any ideas would be appreciated.

Vaya con Dios,
Chuck CABGx3


  #4   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Works in 2000, not in 2007

Thanks Barb, that did the trick.
I opened the .xls workbook in XL2007 and saved it right away as a .xlsm file
and then closed it and re-opened it in XL2007 and ran the macros and all went
fine......dunno why, but it just did. I much appreciate your suggestion.

Yes, to answer your question, it needs to run in both XL2007 and XL2000 for
the time being because we have a LOT of computers here and some of the Users
use XL2000 and some use XL2007 (and actually all the other versions also),
and it's a lot nicer for me if just the one program will run on both and I
don't have to keep track of who gets what version when........will probably
have to get in to that someday soon tho.

Vaya con Dios,
Chuck, CABGx3

"Barb Reinhardt" wrote:

I'm just guessing that your ActiveSheet is in Excel 2000 form (max rows
65536, max cols 256) and ThisWorkbook is in Excel 2007 form with more rows
and columns (I don't know the max of the top of my head.

I'm thinking that if the workbook with your active sheet in it was saved as
a .xlsx file and then you tried to do this, it would work.

Does this code need to be used in both 2000 and 2007?
--
HTH,

Barb Reinhardt



"CLR" wrote:

Hi All.....
I have a program that opens a second file and then copies a sheet out of it
into the main program. It was written in XL2000 and works fine. When I try
to run it in XL2007 it stops on the following line:

ActiveSheet.Copy after:=ThiisWorkbook.sheets(1)

And gives the following error message:

"Excel cannot insert the sheets into the destination workbook, because it
contains fewer rows and columns than the source workbook. To move or copy
the data to the destination workbook, you can select the data, and then use
the Copy and paste commands to insert it into the sheets of another workbook."

The sheet I'm trying to copy is only 450 rows and about 15 columns, and
copies fine in XL2000.

Any ideas would be appreciated.

Vaya con Dios,
Chuck CABGx3


  #5   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Works in 2000, not in 2007

Thanks for responding, but Barb's recommendation did the trick for me this
time.

Vaya con Dios,
Chuck, CABGx3



"fisch4bill" wrote:

Try inserting a blank sheet first and then pasting your data into the empty
sheet - two steps rather than just the one.

"CLR" wrote:

Hi All.....
I have a program that opens a second file and then copies a sheet out of it
into the main program. It was written in XL2000 and works fine. When I try
to run it in XL2007 it stops on the following line:

ActiveSheet.Copy after:=ThiisWorkbook.sheets(1)

And gives the following error message:

"Excel cannot insert the sheets into the destination workbook, because it
contains fewer rows and columns than the source workbook. To move or copy
the data to the destination workbook, you can select the data, and then use
the Copy and paste commands to insert it into the sheets of another workbook."

The sheet I'm trying to copy is only 450 rows and about 15 columns, and
copies fine in XL2000.

Any ideas would be appreciated.

Vaya con Dios,
Chuck CABGx3


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
"If function" works in Excel 2000 but not in 2007 Allen Excel Worksheet Functions 7 October 10th 09 07:16 PM
Code Works Fine in Excel 2007, Excel 2000 generates Runtime Error 438 Safari Excel Programming 0 June 25th 09 03:53 PM
Transfer Works 2000 .wks files to Excel 2007 walkshaw Excel Discussion (Misc queries) 1 April 23rd 09 10:05 AM
xls file works fine in Excel 2000 and 2007 but crashes on opening in 2003 gromit12 Excel Discussion (Misc queries) 2 November 6th 07 09:30 PM
Creating a toolbar that works in Excel 2000 and 2007 Bonsai Bill Excel Programming 3 September 22nd 07 03:01 AM


All times are GMT +1. The time now is 12:09 AM.

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"