View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Copy method of worksheet class failed - help!

In contrast, I opened two workbooks and gave them and their worksheets
corresponding names to those you posted and the code ran flawlessly for me.

--
Regards,
Tom Ogilvy


"Chet Shannon" wrote in message
...
Hi Tom,
I tried the code as you mentioned and I still got the same error message.

Thanks,
Chet
--
Chet Shannon


"Tom Ogilvy" wrote:

All you need is:

Workbooks("2006-01-OAKAM-MOP.xls") _
.Worksheets("OAKAM Facility Diagram").Copy _
Befo=Workbooks("2006-02-OAKAM-MOP.xls") _
.Worksheets("AM Flight Schedule")

--
Regards,
Tom Ogilvy

"Chet Shannon" wrote in message
...
Hi,
Am getting an error that says 'copy method of worksheet class failed".

My
code is
Windows("2006-01-OAKAM-MOP.xls").Activate
Worksheets("OAKAM Facility Diagram").Activate
Sheets("OAKAM Facility Diagram").Copy Befo=Workbooks( _
"2006-02-OAKAM-MOP.xls").Worksheets("AM Flight Schedule")

Is there a workaround or am I doing something wrong? I am just

copying a
worksheet from workbook A to workbook B.

Thanks,
Chet
--
Chet Shannon