Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
corebook.Worksheets(SName).Move befo=newbook.Worksheets("Sheet1")
Can you explain why the above method fails with this error. Run time error 1004 Move method of Worksheet class failed. I am sure corebook and newbook are defined properly. -- Regards and Thanks for any assistance. Francis Brown. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Francis,
Try: Workbooks("Corebook.xls").Sheets(Sname).Move _ befo=Workbooks("NewBook.xls").Sheets("Sheet1") --- Regards, Norman "Francis Brown" wrote in message ... corebook.Worksheets(SName).Move befo=newbook.Worksheets("Sheet1") Can you explain why the above method fails with this error. Run time error 1004 Move method of Worksheet class failed. I am sure corebook and newbook are defined properly. -- Regards and Thanks for any assistance. Francis Brown. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I cant use Newbook.xls as at this point in the procedure newbook is defined
from newbook = workbooks.add so i dont have a name for the workbook as yet. -- Regards and Thanks for any assistance. Francis Brown. "Norman Jones" wrote: Hi Francis, Try: Workbooks("Corebook.xls").Sheets(Sname).Move _ befo=Workbooks("NewBook.xls").Sheets("Sheet1") --- Regards, Norman "Francis Brown" wrote in message ... corebook.Worksheets(SName).Move befo=newbook.Worksheets("Sheet1") Can you explain why the above method fails with this error. Run time error 1004 Move method of Worksheet class failed. I am sure corebook and newbook are defined properly. -- Regards and Thanks for any assistance. Francis Brown. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Francis,
Try: Dim WB As Workbook Set WB = Workbooks.Add Workbooks("Corebook.xls").Sheets(Sname).Move _ befo=WB.Sheets("Sheet1") --- Regards, Norman "Francis Brown" wrote in message ... I cant use Newbook.xls as at this point in the procedure newbook is defined from newbook = workbooks.add so i dont have a name for the workbook as yet. -- Regards and Thanks for any assistance. Francis Brown. "Norman Jones" wrote: Hi Francis, Try: Workbooks("Corebook.xls").Sheets(Sname).Move _ befo=Workbooks("NewBook.xls").Sheets("Sheet1") --- Regards, Norman "Francis Brown" wrote in message ... corebook.Worksheets(SName).Move befo=newbook.Worksheets("Sheet1") Can you explain why the above method fails with this error. Run time error 1004 Move method of Worksheet class failed. I am sure corebook and newbook are defined properly. -- Regards and Thanks for any assistance. Francis Brown. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Then do something like
Set oWb = Workbooks.Add Workbooks("Corebook.xls").Sheets(Sname).Move _ befo=oWb.Sheets("Sheet1") -- HTH RP (remove nothere from the email address if mailing direct) "Francis Brown" wrote in message ... I cant use Newbook.xls as at this point in the procedure newbook is defined from newbook = workbooks.add so i dont have a name for the workbook as yet. -- Regards and Thanks for any assistance. Francis Brown. "Norman Jones" wrote: Hi Francis, Try: Workbooks("Corebook.xls").Sheets(Sname).Move _ befo=Workbooks("NewBook.xls").Sheets("Sheet1") --- Regards, Norman "Francis Brown" wrote in message ... corebook.Worksheets(SName).Move befo=newbook.Worksheets("Sheet1") Can you explain why the above method fails with this error. Run time error 1004 Move method of Worksheet class failed. I am sure corebook and newbook are defined properly. -- Regards and Thanks for any assistance. Francis Brown. |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All.
I think my original code all prety much coresponds in principal to yours. I think the move command has a similar problem to the excel copy command. I discovered by putting all the code in seperate procedure and calling from the primary procedure allows it to run. However if you then run the procedure a second time after adding new data it comes back to the original error. This is why i think it must be similar to the copy command error that happens if that command executes too many times. -- Regards and Thanks for any assistance. Francis Brown. "Bob Phillips" wrote: Then do something like Set oWb = Workbooks.Add Workbooks("Corebook.xls").Sheets(Sname).Move _ befo=oWb.Sheets("Sheet1") -- HTH RP (remove nothere from the email address if mailing direct) "Francis Brown" wrote in message ... I cant use Newbook.xls as at this point in the procedure newbook is defined from newbook = workbooks.add so i dont have a name for the workbook as yet. -- Regards and Thanks for any assistance. Francis Brown. "Norman Jones" wrote: Hi Francis, Try: Workbooks("Corebook.xls").Sheets(Sname).Move _ befo=Workbooks("NewBook.xls").Sheets("Sheet1") --- Regards, Norman "Francis Brown" wrote in message ... corebook.Worksheets(SName).Move befo=newbook.Worksheets("Sheet1") Can you explain why the above method fails with this error. Run time error 1004 Move method of Worksheet class failed. I am sure corebook and newbook are defined properly. -- Regards and Thanks for any assistance. Francis Brown. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Please post this thread a correct full method, method about | New Users to Excel | |||
Please post this thread a complete correct method, method about te | New Users to Excel | |||
"Move Method of Worksheet Class failed" | Excel Programming | |||
Why QUIT method doesn't work after COPY method? | Excel Programming | |||
VBA "move" method? | Excel Programming |