local obj, objsheet
obj = createobject('excel.application')
obj.application.workbooks.open('C:\My Documents\book3.xls')
** if you want to see what you are doing
obj.Application.visible = .t.
** if you don't know the sheet name use the index
* objsheet = obj.Application.Workbooks(1).Worksheets(1)
** if you know the work sheet name
objsheet = obj.Application.Workbooks(1).Worksheets('Sheet1')
objsheet is the sheet that the sheet being moved is being placed.
** move sheet 1 before sheet 3
*obj.Application.Workbooks(1).Worksheets('Sheet3').move(objsheet)
** move sheet 1 after sheet 4
*obj.Application.Workbooks(1).Worksheets('Sheet4').move(,objsheet)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.