Help with Run-time error '32809'

yirrlaar

New Member
Joined
Jul 25, 2011
Messages
18
I'm having an issue moving 1 tab from workbook to another. I even used the built in "record macro" and when I run the macro I always get an the:

Run-time error '32809'
Applications-defined or object-defined error

This is where the issue starts:

Sheets("English Summary").Select
Sheets("English Summary").Copy After:=Workbooks("Test1.xls").Sheets(2)

Any ideas how to resolve this without renaming the "English Summary" tab?

Thanks
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
You may have to reference the workbook in the code if the workbook that contains the sheet "English Summary" isn't the active workbook.

This assumes the workbook with English Summary is the same workbook with the macro.

Code:
[COLOR="Red"]ThisWorkbook.[/COLOR]Sheets("English Summary").Copy After:=Workbooks("Test1.xls").Sheets(2)

Note: you don't have to .Select the worksheet to copy it.
 
Upvote 0
I have the correct workbook selected (see code below). I've noticed that if a tab within a workbook starts with the word "English", copying the tab another workbook causes an issue with the macro.

Windows("Test2.xls").Activate
Sheets("English Summary").Select
Sheets("English Summary").Copy After:=Workbooks("Test1.xls").Sheets(2)
 
Upvote 0
Check the spelling of the sheet name including spaces in between, leading, and trailing. The name in the code has to be exactly the same as the name on the worksheet tab. My guess is a trailing space e.g. "English Summary "
 
Upvote 0
I have checked that. There are no spaces, beginning or end in the tab name.

I used the built in "Record New Macro" to create the macro I posted, so you would think it would take the correct tab name.

Is there a function in Excel VBA called "English" that it might be confusing the sheet selection?
 
Upvote 0
Is there a function in Excel VBA called "English" that it might be confusing the sheet selection?

No VBA function called English.

I don't know what else to tell you. I still think it has something to do with the sheet name in the code not exact matching the name on the tab.

If the worksheet English Summary is always in the same location (e.g. the 1st sheet in Test1.xls), then you can select it based on its position

Code:
Sheets(1).Select

Or the last sheet
Code:
Sheets(Sheets.Count).Select
 
Upvote 0

Forum statistics

Threads
1,224,574
Messages
6,179,634
Members
452,934
Latest member
Jdsonne31

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top