PC Review


Reply
 
 
=?Utf-8?B?U2FuZHk=?=
Guest
Posts: n/a
 
      19th Nov 2007
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 With Quote
 
 
 
 
Ron Rosenfeld
Guest
Posts: n/a
 
      19th Nov 2007
On Mon, 19 Nov 2007 12:40:02 -0800, Sandy <(E-Mail Removed)>
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
 
Reply With Quote
 
=?Utf-8?B?T3NzaWVNYWM=?=
Guest
Posts: n/a
 
      19th Nov 2007
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!
>

 
Reply With Quote
 
=?Utf-8?B?U2FuZHk=?=
Guest
Posts: n/a
 
      20th Nov 2007
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
WINDOWS VISTA, WINDOWS XP ( X64 ) PRO CORP SP2, OFFICE 2007, PROJECT 2007, PUBLISHER 2007, HACKING LESSONS 1-17, other 2006/December/20 new programs leo Windows XP Basics 5 27th Dec 2006 03:18 PM
WINDOWS VISTA, WINDOWS XP ( X64 ) PRO CORP SP2, OFFICE 2007, PROJECT 2007, PUBLISHER 2007, HACKING LESSONS 1-17, other 2006/December/20 new programs kashumoto_tokugawa Windows XP Embedded 0 20th Dec 2006 04:16 AM
WINDOWS VISTA, WINDOWS XP ( X64 ) PRO CORP SP2, OFFICE 2007, PROJECT 2007, PUBLISHER 2007, HACKING LESSONS 1-17, other 2006/December/20 new programs leo Microsoft Dot NET 0 20th Dec 2006 04:08 AM
WINDOWS VISTA, WINDOWS XP ( X64 ) PRO CORP SP2, OFFICE 2007, PROJECT 2007, PUBLISHER 2007, HACKING LESSONS 1-17, other 2006/December/20 new programs leo Microsoft VB .NET 0 20th Dec 2006 04:02 AM
OFFICE 2007 ENTERPRISE UG VL (OFFICE-SOLUTION), PROJECT 2007, PUBLISHER 2007, BRITANNICA 2007, other 2006-11-26 new programs CDs 5200 - 5227, and new games CDs 1945 - 1959 kashumoto_tokugawa Windows XP General 0 26th Nov 2006 12:09 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:09 PM.