From: ub on
Hi
I have written a VBA code to hide formula bar in the Workbook open event.
The code is :
If Application.DisplayFormulaBar = True then
Application.DisplayFormulaBar = False
End if

To bring the formula bar back once I exit out of this workbook, I wrote a
code in workbook before close event and the code is
If Application.DisplayFormulaBar = False then
Application.DisplayFormulaBar = True
End if

I am able to hide the formula bar, but it never brings the formula bar
visible for the application. Every time, after using this sheet, I have to
manualy add the formula bar.

Please advise, how can I correct this problem
From: JLGWhiz on
Try deleting the If statement and just use:

Application.DisplayFormulaBar = True

No error is generated if the Formula Bar is already displayed.


"ub" <ub(a)discussions.microsoft.com> wrote in message
news:0849B68F-F9A6-435F-B833-E33C9E5F9A6C(a)microsoft.com...
> Hi
> I have written a VBA code to hide formula bar in the Workbook open event.
> The code is :
> If Application.DisplayFormulaBar = True then
> Application.DisplayFormulaBar = False
> End if
>
> To bring the formula bar back once I exit out of this workbook, I wrote a
> code in workbook before close event and the code is
> If Application.DisplayFormulaBar = False then
> Application.DisplayFormulaBar = True
> End if
>
> I am able to hide the formula bar, but it never brings the formula bar
> visible for the application. Every time, after using this sheet, I have to
> manualy add the formula bar.
>
> Please advise, how can I correct this problem


From: ub on
Hi
Thanks for the reply

I tried with removing the if statement and it still does not work.

Please advise


"JLGWhiz" wrote:

> Try deleting the If statement and just use:
>
> Application.DisplayFormulaBar = True
>
> No error is generated if the Formula Bar is already displayed.
>
>
> "ub" <ub(a)discussions.microsoft.com> wrote in message
> news:0849B68F-F9A6-435F-B833-E33C9E5F9A6C(a)microsoft.com...
> > Hi
> > I have written a VBA code to hide formula bar in the Workbook open event.
> > The code is :
> > If Application.DisplayFormulaBar = True then
> > Application.DisplayFormulaBar = False
> > End if
> >
> > To bring the formula bar back once I exit out of this workbook, I wrote a
> > code in workbook before close event and the code is
> > If Application.DisplayFormulaBar = False then
> > Application.DisplayFormulaBar = True
> > End if
> >
> > I am able to hide the formula bar, but it never brings the formula bar
> > visible for the application. Every time, after using this sheet, I have to
> > manualy add the formula bar.
> >
> > Please advise, how can I correct this problem
>
>
>
From: JLGWhiz on
After thought. You will also need to save the workbook after you re-instate
the Formula Bar, otherwise it will open in the last saved state.


"ub" <ub(a)discussions.microsoft.com> wrote in message
news:0849B68F-F9A6-435F-B833-E33C9E5F9A6C(a)microsoft.com...
> Hi
> I have written a VBA code to hide formula bar in the Workbook open event.
> The code is :
> If Application.DisplayFormulaBar = True then
> Application.DisplayFormulaBar = False
> End if
>
> To bring the formula bar back once I exit out of this workbook, I wrote a
> code in workbook before close event and the code is
> If Application.DisplayFormulaBar = False then
> Application.DisplayFormulaBar = True
> End if
>
> I am able to hide the formula bar, but it never brings the formula bar
> visible for the application. Every time, after using this sheet, I have to
> manualy add the formula bar.
>
> Please advise, how can I correct this problem


From: ub on
I added code
activeworkbook.save
after the Application.DisplayFormulaBar = True statement.
But it still does not work.

Please advise, if I need to change the save statement

"JLGWhiz" wrote:

> After thought. You will also need to save the workbook after you re-instate
> the Formula Bar, otherwise it will open in the last saved state.
>
>
> "ub" <ub(a)discussions.microsoft.com> wrote in message
> news:0849B68F-F9A6-435F-B833-E33C9E5F9A6C(a)microsoft.com...
> > Hi
> > I have written a VBA code to hide formula bar in the Workbook open event.
> > The code is :
> > If Application.DisplayFormulaBar = True then
> > Application.DisplayFormulaBar = False
> > End if
> >
> > To bring the formula bar back once I exit out of this workbook, I wrote a
> > code in workbook before close event and the code is
> > If Application.DisplayFormulaBar = False then
> > Application.DisplayFormulaBar = True
> > End if
> >
> > I am able to hide the formula bar, but it never brings the formula bar
> > visible for the application. Every time, after using this sheet, I have to
> > manualy add the formula bar.
> >
> > Please advise, how can I correct this problem
>
>
>