INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

COM and Automation

moving excel worksheet by danceman
Posted: 30 Jul 02 (Edited 25 Jan 07)

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)

Back to Microsoft: Visual FoxPro FAQ Index
Back to Microsoft: Visual FoxPro Forum

My Archive

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close