Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How to position to a specific sheet before saving

I'm creating an Excel workbook from VB6 that contains exported SQL Server
data. The workbook can contain more than one sheet - when I'm ready to save
it, how can I reposition to the first sheet? I've tried the following code,
but when re-opening the workbook it opens to the last sheet created:

Set oSheet = oWB.Worksheets(1)
oWB.SaveAs (msExcelPath & msExcelFileName)

Any help would be appreciated. Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default How to position to a specific sheet before saving

Try...

Set oSheet = oWB.Worksheets(1)
oSheet.Select
oWB.SaveAs (msExcelPath & msExcelFileName)

--
HTH...

Jim Thomlinson


"Pete Kipe" wrote:

I'm creating an Excel workbook from VB6 that contains exported SQL Server
data. The workbook can contain more than one sheet - when I'm ready to save
it, how can I reposition to the first sheet? I've tried the following code,
but when re-opening the workbook it opens to the last sheet created:

Set oSheet = oWB.Worksheets(1)
oWB.SaveAs (msExcelPath & msExcelFileName)

Any help would be appreciated. Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How to position to a specific sheet before saving

Many thanks, Jim. Works perfectly now. Pete

"Jim Thomlinson" wrote:

Try...

Set oSheet = oWB.Worksheets(1)
oSheet.Select
oWB.SaveAs (msExcelPath & msExcelFileName)

--
HTH...

Jim Thomlinson


"Pete Kipe" wrote:

I'm creating an Excel workbook from VB6 that contains exported SQL Server
data. The workbook can contain more than one sheet - when I'm ready to save
it, how can I reposition to the first sheet? I've tried the following code,
but when re-opening the workbook it opens to the last sheet created:

Set oSheet = oWB.Worksheets(1)
oWB.SaveAs (msExcelPath & msExcelFileName)

Any help would be appreciated. Thanks!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cursor position after saving JimK Excel Discussion (Misc queries) 2 December 8th 09 08:45 PM
Linking a specific x/y position in a table TheMilkGuy Excel Discussion (Misc queries) 3 August 15th 07 05:25 PM
how do I obtain position of specific value in a row of numbers anand Excel Worksheet Functions 5 September 17th 06 07:32 AM
Replacing a specific position in a cell with something else McDal Excel Discussion (Misc queries) 5 May 3rd 05 08:37 PM
Saving a position dinamically Manu Palao Excel Worksheet Functions 1 November 10th 04 03:08 PM


All times are GMT +1. The time now is 02:42 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"