ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Can anyone solve this mystery? (https://www.excelbanter.com/excel-programming/317444-can-anyone-solve-mystery.html)

JK

Can anyone solve this mystery?
 
My toolbar includes a Preview Reports menu that attempts to mimic Excel's
Print Preview. The report opens with its own toolbar and sheet tabs hidden.
When preview is closed, the worksheets reappear with sheet tabs visible. So
far so good. Here's the mystery. Sometimes (not always), when preview is
closed and a sheet tab is clicked, the sheet tabs disappear.

Unless my program is haunted, there must be a logical explanation (though I
can't figure it out). Please help if you can. Thank you.

Jim Kobzeff



Philo Hippo

Can anyone solve this mystery?
 
Same happens to me and can't figure out why.

You could use the CBOOL expression to find out from the
Workbook_SheetActivate if the tabs are displayed or Hidden and force Excel
accordingly.

If Not CBool(ActiveWindow.DisplayWorkbookTabs = True) Then
ActiveWindow.DisplayWorkbookTabs = True
--

Hope that helps,

Phil

------------------------------------------

IT Analyst
SE1, London, UK,

http://uk.geocities.com/philippeoget
philippeoget at yahoo dot com

Programming Excel: <a
href="http://uk.geocities.com/philippeoget/xl/InternetLinkOrganiser.zip"
target="_blank"The Excel A2Z Project: </a
http://uk.geocities.com/philippeoget/a2z/

"JK" wrote in message news:G3Lnd.1659$1B2.1508@trnddc02...
My toolbar includes a Preview Reports menu that attempts to mimic Excel's
Print Preview. The report opens with its own toolbar and sheet tabs
hidden. When preview is closed, the worksheets reappear with sheet tabs
visible. So far so good. Here's the mystery. Sometimes (not always), when
preview is closed and a sheet tab is clicked, the sheet tabs disappear.

Unless my program is haunted, there must be a logical explanation (though
I can't figure it out). Please help if you can. Thank you.

Jim Kobzeff




Myrna Larson

Can anyone solve this mystery?
 
Why bother? The property returns a Boolean. From Help:

DisplayWorkbookTabs Property

True if the workbook tabs are displayed. Read/write *Boolean*

And an IF statement always returns a Boolean, TRUE or FALSE.

If ActiveWindow.DisplayWorkbookTabs = False Then

But you could just display them in any case with

ActiveWindow.DisplayWorkbookTabs = True


On Sun, 21 Nov 2004 19:53:36 -0000, "Philo Hippo"
wrote:

Same happens to me and can't figure out why.

You could use the CBOOL expression to find out from the
Workbook_SheetActivate if the tabs are displayed or Hidden and force Excel
accordingly.

If Not CBool(ActiveWindow.DisplayWorkbookTabs = True) Then
ActiveWindow.DisplayWorkbookTabs = True




All times are GMT +1. The time now is 07:44 AM.

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