Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
The following bit of code has been working previously excel2003 Dim wks as worksheet Dim actWkbk As Workbook Set actWkbk = ActiveWorkbook With act wkbk ..Worksheets("Sheet1").copy End with now in 2007 I am getting Method 'Copy' of object '_Worksheet failed' What has changed? Thanks! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Mon, 19 Nov 2007 12:40:02 -0800, Sandy
wrote: Hi The following bit of code has been working previously excel2003 Dim wks as worksheet Dim actWkbk As Workbook Set actWkbk = ActiveWorkbook With act wkbk .Worksheets("Sheet1").copy End with now in 2007 I am getting Method 'Copy' of object '_Worksheet failed' What has changed? Thanks! Could it be the <space between 'act' and 'wkbk' ? Probably combined with no Option Explicit statement. --ron |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Sandy,
I am using xl2007 with Windows Vista Home and your code works perfectly for me. (I had to remove the space in 'With act wkbk'; but I assume that is only a typo when you posted.) It creates a new workbook with only one worksheet. -- Regards, OssieMac "Sandy" wrote: Hi The following bit of code has been working previously excel2003 Dim wks as worksheet Dim actWkbk As Workbook Set actWkbk = ActiveWorkbook With act wkbk .Worksheets("Sheet1").copy End with now in 2007 I am getting Method 'Copy' of object '_Worksheet failed' What has changed? Thanks! |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks!
The space was a typo. It appears the problem is the macro is running from an xls (65000lines X 256 Colimns) and it is copying this sheet into an .xlsm with a Gazillion columns x 256 katrillion lines. Thanks again! "Sandy" wrote: Hi The following bit of code has been working previously excel2003 Dim wks as worksheet Dim actWkbk As Workbook Set actWkbk = ActiveWorkbook With act wkbk .Worksheets("Sheet1").copy End with now in 2007 I am getting Method 'Copy' of object '_Worksheet failed' What has changed? Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copying Excel 2007 chart to Word 2007 - only half of it shows | Excel Discussion (Misc queries) | |||
Analysis Toolpack Issues in Excel 2007 (Office 2007 Enterprise) | Excel Discussion (Misc queries) | |||
Excel 2007 Query Wizard problem with Access 2007 extensions | Excel Discussion (Misc queries) | |||
Labels: Unable to import all records Excel 2007 to Word 2007 Mailm | Excel Discussion (Misc queries) | |||
Paste EXCEL 2007 sheet into WORD 2007 - objects move around | Excel Discussion (Misc queries) |