excel 2010 + copy array

K

kevcar40

Hi
I have a workbook created in excel 2003
which uses Vba to copy worksheets and save them as a stand alone work workbook
the code is
ThisWorkbook.Worksheets(Array("sheet1")).Copy
the problem is this is crashing in excel 2010
does anyone know the reason whyand what the solution is please


thanks

kevin
 
D

Don Guillett

Hi

I have a workbook created in excel 2003

which uses Vba to copy worksheets and save them as a stand alone work workbook

the code is

ThisWorkbook.Worksheets(Array("sheet1")).Copy

the problem is this is crashing in excel 2010

does anyone know the reason whyand what the solution is please





thanks



kevin

Why you would have an array of ONE I don't know but your code did work in my xl2010
 
K

kevcar40

Hi I have a workbook created in excel 2003 which uses Vba to copy worksheets and save them as a stand alone work workbook the code is ThisWorkbook.Worksheets(Array("sheet1")).Copy the problem is this is crashing in excel 2010 does anyone know the reason whyand what the solution is please thanks kevin

Don
Thanks for reply
the reason i use array is this is the way i was taught to copy a sheet out of a workbook.
if there is another method please let me know

thanks

kevin
 
D

Don Guillett

Hi

I have a workbook created in excel 2003

which uses Vba to copy worksheets and save them as a stand alone work workbook

the code is

ThisWorkbook.Worksheets(Array("sheet1")).Copy

the problem is this is crashing in excel 2010

does anyone know the reason whyand what the solution is please




thanks



kevin


ThisWorkbook.Worksheets("sheet1").Copy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top