"Move Method of Worksheet Class failed"

A

azurmendi

Hello!!

I get the error:
"Move Method of Worksheet Class failed"
when I write this instruction:

Workbooks(gestion).Worksheets(plantilla_pedido).Move
After:=Workbooks(pedidosPend).Worksheets(indice)

I've changed Move by Copy, but I get the same error with Copy.

I have read this article in Microsoft but I don't find any solution.
http://support.microsoft.com/default.aspx?scid=kb;en-us;210684&Product=xlw

May anybody help me?

Thanks very much in advance!!!

Regards,
María
 
L

Leith Ross

Hello Maria,

I would check the Workbook Security levels first and then check if any
of the Worksheets might be protected. If neither of those are problem
then the problem most likely lies within the macro code somewhere.

Sincerely,
Leith Ross
 
T

Tom Ogilvy

Note also that the article talks about copying a worksheet within the same
workbook which you are neither copying or working within the same workbook -
so I don't think that article has anything to offer you. In fact, it
suggest that copying from one workbook to another as a solution.

As Leith has pointed out, there is nothing intrinsically wrong with the
code - so the next thing to look at is your environment. Certainly if the
destination or source or both workbooks are protected, this would be
problematic.
 
A

azurmendi

Hello!!

Thanks very much for your suggestions.

My intention is to move a sheet from a Workbook to another workbook. Both
of them are unprotected.
And my problem is that the error grows when I move the 100 sheet.

Any idea?

Thanks in advance!!

Regards,
María
 
T

Tom Ogilvy

Try moving them in groups rather than one at a time.

If your moving that many sheets, it may be easier to copy them all, then
delete the ones you don't want, then delete the ones in the old workbook I
can't really say since I don't know exactly what you are about, but you want
to minimize the number of actions you take.
 

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