WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE with Excel
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Excel Move Sheet


Question:

I've created a macro to move one sheet after another and now want to convert to WB. Have tried various combinations and permutations but no luck yet.

This is the VBA code

Sheets("Sheet1").Select
Sheets("Sheet1").Move After:=Sheets(2)

Answer:

XLApp = ObjectOpen("Excel.Application")
XLApp.Visible = @TRUE
XLWorkBooksColl = XLApp.Workbooks
xfile = "C:\Jay\bin\Test.xls"
MyXLWorkBook = XLWorkBooksColl.Open(xfile) 

XLActiveSheet = MyXLWorkBook.ActiveSheet
XLActiveSheet.activate


objRange = XLApp.Range("A1")
objRange.Select

For row = 1 To 1
     Message("Debug", objRange.Cells(Row, 1).value)
Next

XLApp.Worksheets("Eaprint").Move(::After=XLApp.Worksheets(2))




Article ID:   W16612
File Created: 2005:02:18:12:21:38
Last Updated: 2005:02:18:12:21:38