Thread: 2007 Help
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default 2007 Help

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