Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Cursor position after saving | Excel Discussion (Misc queries) | |||
Linking a specific x/y position in a table | Excel Discussion (Misc queries) | |||
how do I obtain position of specific value in a row of numbers | Excel Worksheet Functions | |||
Replacing a specific position in a cell with something else | Excel Discussion (Misc queries) | |||
Saving a position dinamically | Excel Worksheet Functions |