Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OLE command to move an excel sheet

Status
Not open for further replies.

reevda

Programmer
Sep 30, 2002
16
CH
Hi everybody,

Trying unsuccessfully to find the correct syntax to move a sheet in excel through OLE. (PB 8.02 with WXP pro.)

Code which is ok:
----------------
xlapp.Application.ActiveWorkbook.Worksheets.Add
xlapp.Application.ActiveWorkbook.Worksheets("sheet1").Name = "last"
xlsub = xlapp.Application.ActiveWorkbook.Worksheets("last")

Code not ok:
-----------------
xlsub.move ("After:=Sheets(3)")
( the macro code in excel is [Sheets("last").Move After:=Sheets(3)], with space between Move and After. )

Error:
------------------
Error calling external function move at line 39 in clicked events of object cb_1 of w_main.

Can anybody help?
Thanks in advance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top