ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Opening Excel file on a specific worksheet (https://www.excelbanter.com/excel-worksheet-functions/121868-opening-excel-file-specific-worksheet.html)

sdhaight

Opening Excel file on a specific worksheet
 
Hello,

I have read some of your postings and found the macro below to open the file
on a specific worksheet but I'm wondering if there's a function besides a
macro for doing this. My concern is that our file will be used by 100
different users on different versions of Excel so I'm not sure it will work
consistently. Also, unless macro security is set to low, the user will be
promted to enable the macro and it won't work if they say no. Any other
options?

Private Sub Workbook_Open()
Worksheets("Sheet1").Activate
End Sub

Thanks so much,
Sherry

Dave Peterson

Opening Excel file on a specific worksheet
 
If the workbook is saved with Sheet1 active, then it'll open to that sheet.



sdhaight wrote:

Hello,

I have read some of your postings and found the macro below to open the file
on a specific worksheet but I'm wondering if there's a function besides a
macro for doing this. My concern is that our file will be used by 100
different users on different versions of Excel so I'm not sure it will work
consistently. Also, unless macro security is set to low, the user will be
promted to enable the macro and it won't work if they say no. Any other
options?

Private Sub Workbook_Open()
Worksheets("Sheet1").Activate
End Sub

Thanks so much,
Sherry


--

Dave Peterson

CLR

Opening Excel file on a specific worksheet
 
The file will automatically open to the sheet that was open at it's last
save..........

hth
Vaya con Dios,
Chuck, CABGx3



"sdhaight" wrote:

Hello,

I have read some of your postings and found the macro below to open the file
on a specific worksheet but I'm wondering if there's a function besides a
macro for doing this. My concern is that our file will be used by 100
different users on different versions of Excel so I'm not sure it will work
consistently. Also, unless macro security is set to low, the user will be
promted to enable the macro and it won't work if they say no. Any other
options?

Private Sub Workbook_Open()
Worksheets("Sheet1").Activate
End Sub

Thanks so much,
Sherry


sdhaight

Opening Excel file on a specific worksheet
 
I know but I can't control what page other users may be on when they save so
I need something that will always go back to sheet1 when the next user opens
the file regardless of where the last user saved.

"Dave Peterson" wrote:

If the workbook is saved with Sheet1 active, then it'll open to that sheet.



sdhaight wrote:

Hello,

I have read some of your postings and found the macro below to open the file
on a specific worksheet but I'm wondering if there's a function besides a
macro for doing this. My concern is that our file will be used by 100
different users on different versions of Excel so I'm not sure it will work
consistently. Also, unless macro security is set to low, the user will be
promted to enable the macro and it won't work if they say no. Any other
options?

Private Sub Workbook_Open()
Worksheets("Sheet1").Activate
End Sub

Thanks so much,
Sherry


--

Dave Peterson


Gord Dibben

Opening Excel file on a specific worksheet
 
Without code the only way is to save the workbook with that particular sheet
active.

A workaround is to add before_close code that renders the workbook unusable if
users open without enabling macros.

This would consist of code that hides all the sheets except a message sheet that
says "You have disabled macros. Close then re-open this workbook with macros
enabled or go home for the day since you have nothing to do!"


Gord Dibben MS Excel MVP


On Thu, 7 Dec 2006 09:47:00 -0800, sdhaight
wrote:

Hello,

I have read some of your postings and found the macro below to open the file
on a specific worksheet but I'm wondering if there's a function besides a
macro for doing this. My concern is that our file will be used by 100
different users on different versions of Excel so I'm not sure it will work
consistently. Also, unless macro security is set to low, the user will be
promted to enable the macro and it won't work if they say no. Any other
options?

Private Sub Workbook_Open()
Worksheets("Sheet1").Activate
End Sub

Thanks so much,
Sherry



Elkar

Opening Excel file on a specific worksheet
 
You could add a BeforeSave event code to change the sheet to the appropriate
one. Something like:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Worksheets("Sheet1").Activate
End Sub

HTH,
Elkar


"sdhaight" wrote:

I know but I can't control what page other users may be on when they save so
I need something that will always go back to sheet1 when the next user opens
the file regardless of where the last user saved.

"Dave Peterson" wrote:

If the workbook is saved with Sheet1 active, then it'll open to that sheet.



sdhaight wrote:

Hello,

I have read some of your postings and found the macro below to open the file
on a specific worksheet but I'm wondering if there's a function besides a
macro for doing this. My concern is that our file will be used by 100
different users on different versions of Excel so I'm not sure it will work
consistently. Also, unless macro security is set to low, the user will be
promted to enable the macro and it won't work if they say no. Any other
options?

Private Sub Workbook_Open()
Worksheets("Sheet1").Activate
End Sub

Thanks so much,
Sherry


--

Dave Peterson


Dave Peterson

Opening Excel file on a specific worksheet
 
But that suffers from the same problem (allowing macros) that workbook_open has.

And even worse, if you save without closing, then you may be on a different
worksheet when the save finishes. (That would be very irritating to me.)

Elkar wrote:

You could add a BeforeSave event code to change the sheet to the appropriate
one. Something like:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Worksheets("Sheet1").Activate
End Sub

HTH,
Elkar

"sdhaight" wrote:

I know but I can't control what page other users may be on when they save so
I need something that will always go back to sheet1 when the next user opens
the file regardless of where the last user saved.

"Dave Peterson" wrote:

If the workbook is saved with Sheet1 active, then it'll open to that sheet.



sdhaight wrote:

Hello,

I have read some of your postings and found the macro below to open the file
on a specific worksheet but I'm wondering if there's a function besides a
macro for doing this. My concern is that our file will be used by 100
different users on different versions of Excel so I'm not sure it will work
consistently. Also, unless macro security is set to low, the user will be
promted to enable the macro and it won't work if they say no. Any other
options?

Private Sub Workbook_Open()
Worksheets("Sheet1").Activate
End Sub

Thanks so much,
Sherry

--

Dave Peterson


--

Dave Peterson

Dave Peterson

Opening Excel file on a specific worksheet
 
Then I think you'll have to use a macro.

And if the user chooses to disable macros, then they'll have to select the
worksheet manually (which doesn't sound too difficult to me).

sdhaight wrote:

I know but I can't control what page other users may be on when they save so
I need something that will always go back to sheet1 when the next user opens
the file regardless of where the last user saved.

"Dave Peterson" wrote:

If the workbook is saved with Sheet1 active, then it'll open to that sheet.



sdhaight wrote:

Hello,

I have read some of your postings and found the macro below to open the file
on a specific worksheet but I'm wondering if there's a function besides a
macro for doing this. My concern is that our file will be used by 100
different users on different versions of Excel so I'm not sure it will work
consistently. Also, unless macro security is set to low, the user will be
promted to enable the macro and it won't work if they say no. Any other
options?

Private Sub Workbook_Open()
Worksheets("Sheet1").Activate
End Sub

Thanks so much,
Sherry


--

Dave Peterson


--

Dave Peterson


All times are GMT +1. The time now is 03:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com