ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Status & Formula Bar Disabling Prevention Among Other Opened Workb (https://www.excelbanter.com/excel-programming/405184-status-formula-bar-disabling-prevention-among-other-opened-workb.html)

Edd[_2_]

Status & Formula Bar Disabling Prevention Among Other Opened Workb
 
HI,

I want to disable the Status and Formula bars for a workbook when it is
opened but only for this one specific workbook and not for any other opened
workbooks. I use the below two lines of code.

Application.DisplayStatusBar = False
Application.DisplayFormulaBar = False

How can I prevent these actions from occuring with other opened workbooks?

Thanks,

Jim Thomlinson

Status & Formula Bar Disabling Prevention Among Other Opened Workb
 
You need to go to thisworkbook and place code in the necessary worbook events
to capture when you are looking at the current workbook. Something like
this...

Private Sub Workbook_Activate()
Application.DisplayStatusBar = False
Application.DisplayFormulaBar = False
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.DisplayStatusBar = True
Application.DisplayFormulaBar = True
End Sub

Private Sub Workbook_Deactivate()
Application.DisplayStatusBar = True
Application.DisplayFormulaBar = True
End Sub

Private Sub Workbook_Open()
Application.DisplayStatusBar = False
Application.DisplayFormulaBar = False
End Sub

--
HTH...

Jim Thomlinson


"Edd" wrote:

HI,

I want to disable the Status and Formula bars for a workbook when it is
opened but only for this one specific workbook and not for any other opened
workbooks. I use the below two lines of code.

Application.DisplayStatusBar = False
Application.DisplayFormulaBar = False

How can I prevent these actions from occuring with other opened workbooks?

Thanks,


Edd[_2_]

Status & Formula Bar Disabling Prevention Among Other Opened W
 
Jim,

With you help, I got it to work.....thank you for your insight!

Ed.


"Jim Thomlinson" wrote:

You need to go to thisworkbook and place code in the necessary worbook events
to capture when you are looking at the current workbook. Something like
this...

Private Sub Workbook_Activate()
Application.DisplayStatusBar = False
Application.DisplayFormulaBar = False
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.DisplayStatusBar = True
Application.DisplayFormulaBar = True
End Sub

Private Sub Workbook_Deactivate()
Application.DisplayStatusBar = True
Application.DisplayFormulaBar = True
End Sub

Private Sub Workbook_Open()
Application.DisplayStatusBar = False
Application.DisplayFormulaBar = False
End Sub

--
HTH...

Jim Thomlinson


"Edd" wrote:

HI,

I want to disable the Status and Formula bars for a workbook when it is
opened but only for this one specific workbook and not for any other opened
workbooks. I use the below two lines of code.

Application.DisplayStatusBar = False
Application.DisplayFormulaBar = False

How can I prevent these actions from occuring with other opened workbooks?

Thanks,


Edd[_2_]

Status & Formula Bar Disabling Prevention Among Other Opened W
 
Jim,

How can I prevent the activate event from firing when I go a different
worksheet within the same workbook? I only want it to fire for one of the
worksheets and not the rest. I tried something like the below to fire when
only sheet1 is in focus, but it does not work. Can you please help? Thanks!

Private Sub WorkbookActivate()
If Sheet1.Visible Then
Application.DisplayStatusBar = False
Application.DisplayFormulaBar = False
End If
End Sub

(Note: I also tried the windowactivate, sheetactivate, and they seem to
operate identically, and they do not work).



"Jim Thomlinson" wrote:

You need to go to thisworkbook and place code in the necessary worbook events
to capture when you are looking at the current workbook. Something like
this...

Private Sub Workbook_Activate()
Application.DisplayStatusBar = False
Application.DisplayFormulaBar = False
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.DisplayStatusBar = True
Application.DisplayFormulaBar = True
End Sub

Private Sub Workbook_Deactivate()
Application.DisplayStatusBar = True
Application.DisplayFormulaBar = True
End Sub

Private Sub Workbook_Open()
Application.DisplayStatusBar = False
Application.DisplayFormulaBar = False
End Sub

--
HTH...

Jim Thomlinson


"Edd" wrote:

HI,

I want to disable the Status and Formula bars for a workbook when it is
opened but only for this one specific workbook and not for any other opened
workbooks. I use the below two lines of code.

Application.DisplayStatusBar = False
Application.DisplayFormulaBar = False

How can I prevent these actions from occuring with other opened workbooks?

Thanks,


Dave Peterson

Status & Formula Bar Disabling Prevention Among Other Opened W
 
There is a worksheet event (not a workbook level event) that can be used. It
goes in under the worksheet that you want (rightclick on that worksheet's tab
and select view code.)

It'll fire when you go from any other sheet in this same workbook to this sheet.

Option Explicit
Private Sub Worksheet_Activate()
msgbox "hi from: " & me.name
End Sub

It won't fire when you change from one workbook to this workbook.


Edd wrote:

Jim,

How can I prevent the activate event from firing when I go a different
worksheet within the same workbook? I only want it to fire for one of the
worksheets and not the rest. I tried something like the below to fire when
only sheet1 is in focus, but it does not work. Can you please help? Thanks!

Private Sub WorkbookActivate()
If Sheet1.Visible Then
Application.DisplayStatusBar = False
Application.DisplayFormulaBar = False
End If
End Sub

(Note: I also tried the windowactivate, sheetactivate, and they seem to
operate identically, and they do not work).

"Jim Thomlinson" wrote:

You need to go to thisworkbook and place code in the necessary worbook events
to capture when you are looking at the current workbook. Something like
this...

Private Sub Workbook_Activate()
Application.DisplayStatusBar = False
Application.DisplayFormulaBar = False
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.DisplayStatusBar = True
Application.DisplayFormulaBar = True
End Sub

Private Sub Workbook_Deactivate()
Application.DisplayStatusBar = True
Application.DisplayFormulaBar = True
End Sub

Private Sub Workbook_Open()
Application.DisplayStatusBar = False
Application.DisplayFormulaBar = False
End Sub

--
HTH...

Jim Thomlinson


"Edd" wrote:

HI,

I want to disable the Status and Formula bars for a workbook when it is
opened but only for this one specific workbook and not for any other opened
workbooks. I use the below two lines of code.

Application.DisplayStatusBar = False
Application.DisplayFormulaBar = False

How can I prevent these actions from occuring with other opened workbooks?

Thanks,


--

Dave Peterson

Edd[_2_]

Status & Formula Bar Disabling Prevention Among Other Opened W
 
Dave,

"It goes in under the worksheet," now why did I not think of that??? Well,
I'm glad I have you guys to think for me. That worked as I intended. Thanks
so much!!

Ed.



"Dave Peterson" wrote:

There is a worksheet event (not a workbook level event) that can be used. It
goes in under the worksheet that you want (rightclick on that worksheet's tab
and select view code.)

It'll fire when you go from any other sheet in this same workbook to this sheet.

Option Explicit
Private Sub Worksheet_Activate()
msgbox "hi from: " & me.name
End Sub

It won't fire when you change from one workbook to this workbook.


Edd wrote:

Jim,

How can I prevent the activate event from firing when I go a different
worksheet within the same workbook? I only want it to fire for one of the
worksheets and not the rest. I tried something like the below to fire when
only sheet1 is in focus, but it does not work. Can you please help? Thanks!

Private Sub WorkbookActivate()
If Sheet1.Visible Then
Application.DisplayStatusBar = False
Application.DisplayFormulaBar = False
End If
End Sub

(Note: I also tried the windowactivate, sheetactivate, and they seem to
operate identically, and they do not work).

"Jim Thomlinson" wrote:

You need to go to thisworkbook and place code in the necessary worbook events
to capture when you are looking at the current workbook. Something like
this...

Private Sub Workbook_Activate()
Application.DisplayStatusBar = False
Application.DisplayFormulaBar = False
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.DisplayStatusBar = True
Application.DisplayFormulaBar = True
End Sub

Private Sub Workbook_Deactivate()
Application.DisplayStatusBar = True
Application.DisplayFormulaBar = True
End Sub

Private Sub Workbook_Open()
Application.DisplayStatusBar = False
Application.DisplayFormulaBar = False
End Sub

--
HTH...

Jim Thomlinson


"Edd" wrote:

HI,

I want to disable the Status and Formula bars for a workbook when it is
opened but only for this one specific workbook and not for any other opened
workbooks. I use the below two lines of code.

Application.DisplayStatusBar = False
Application.DisplayFormulaBar = False

How can I prevent these actions from occuring with other opened workbooks?

Thanks,


--

Dave Peterson



All times are GMT +1. The time now is 08:07 PM.

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