Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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, |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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, |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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, |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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, |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
reuest formula for auto update status & status date | Excel Worksheet Functions | |||
Prevention of Printing | Excel Discussion (Misc queries) | |||
Closing Form and prevention | Excel Programming | |||
Excel Question Prevention | Excel Programming | |||
write a formula to sum cells on different pages of the same workb. | Excel Worksheet Functions |