View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] zgu@askom.com.pl is offline
external usenet poster
 
Posts: 3
Default Excell automation - How to move sheet using late binding and VB.NET

I am looking for the code sample which allows to change the sheet's
position inside workbook via Excel's Move() method, using late binding
and VB.NET.
Simply I'd like to do something like this :

....

Dim Workbook As Object
Workbook = Workbooks.Open(fname)
Dim Sheets As Object
Sheets = Workbook.Worksheets
Dim Sheet1 As Object
Sheet1 = Sheets.Add()
Sheet1.Name = "A"
Dim Sheet2 As Object
Sheet2 = Sheets.Add()
Sheet2.Name = "B"
' I'd like to move sheet "B" after sheet "A"
Sheets("B").Move(???)


Zbyszek Gubrynowicz