ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Puzzling attribute - trying again (https://www.excelbanter.com/excel-programming/439870-puzzling-attribute-trying-again.html)

Bony Pony[_3_]

Puzzling attribute - trying again
 
Hi all,
Does anyone know why the command
ActiveWindow.DisplayWorkbookTabs = True or
ActiveWindow.DisplayWorkbookTabs = False

anywhere in an activeworkbook kicks off the prompt to save a hidden (and
untouched) Personal.xlsb when Excel is closed?

Kind regards,
Bony
--
"There are 10 types of people in this world. Those who understand Binary
and those who don''t ..."

--
"There are 10 types of people in this world. Those who understand Binary
and those who don''t ..."

Peter T

Puzzling attribute - trying again
 
Normally that should not changed the Saved property (unless of course your
Personal is visible and active). Maybe the following will shed some light

Sub Test()
dim wb as Workbook
Set wb = Workbooks("personal.xlsb")
If wb.Saved = False Then
Debug.Print "hmm! reset Saved"
wb.Saved = True
End If
With ActiveWindow
.DisplayWorkbookTabs = Not .DisplayWorkbookTabs
End With
Debug.Print wb.Saved ' ?
Debug.Print ActiveWindow.Parent.Name ' ?
End Sub

Regards,
Peter T

"Bony Pony" wrote in message
...
Hi all,
Does anyone know why the command
ActiveWindow.DisplayWorkbookTabs = True or
ActiveWindow.DisplayWorkbookTabs = False

anywhere in an activeworkbook kicks off the prompt to save a hidden (and
untouched) Personal.xlsb when Excel is closed?

Kind regards,
Bony
--
"There are 10 types of people in this world. Those who understand Binary
and those who don''t ..."

--
"There are 10 types of people in this world. Those who understand Binary
and those who don''t ..."




Bony Pony[_3_]

Puzzling attribute - trying again
 
Hi Peter,
many thanks for the reply.

Actually, I had a module similar to what you kindly posted. That's how I
spotted the problem in the first place. Even running through your code it
causes the issue. You need to run the module twice and on the second time,
you will see the wb.saved changes to false ...

My personal.xlsb is hidden, inactive and the vba project locked. The
activewindow.parent.name comes back with the correct activesheet as well.
Very strange!!

Thanks again!

Kind regards, Bony
--
"There are 10 types of people in this world. Those who understand Binary
and those who don''t ..."


"Peter T" wrote:

Normally that should not changed the Saved property (unless of course your
Personal is visible and active). Maybe the following will shed some light

Sub Test()
dim wb as Workbook
Set wb = Workbooks("personal.xlsb")
If wb.Saved = False Then
Debug.Print "hmm! reset Saved"
wb.Saved = True
End If
With ActiveWindow
.DisplayWorkbookTabs = Not .DisplayWorkbookTabs
End With
Debug.Print wb.Saved ' ?
Debug.Print ActiveWindow.Parent.Name ' ?
End Sub

Regards,
Peter T

"Bony Pony" wrote in message
...
Hi all,
Does anyone know why the command
ActiveWindow.DisplayWorkbookTabs = True or
ActiveWindow.DisplayWorkbookTabs = False

anywhere in an activeworkbook kicks off the prompt to save a hidden (and
untouched) Personal.xlsb when Excel is closed?

Kind regards,
Bony
--
"There are 10 types of people in this world. Those who understand Binary
and those who don''t ..."

--
"There are 10 types of people in this world. Those who understand Binary
and those who don''t ..."



.


Peter T

Puzzling attribute - trying again
 
Try as described below

- start a new session of Excel
- add a new module to the Book1 project
- paste the Test macro I posted last time into the new module
- run the macro twice. press F5 with the cursor in the macro

This is what I got in the Immediate window
Book1
True
Book1
True

What do you get ?

Regards,
Peter T


"Bony Pony" wrote in message
...
Hi Peter,
many thanks for the reply.

Actually, I had a module similar to what you kindly posted. That's how I
spotted the problem in the first place. Even running through your code it
causes the issue. You need to run the module twice and on the second
time,
you will see the wb.saved changes to false ...

My personal.xlsb is hidden, inactive and the vba project locked. The
activewindow.parent.name comes back with the correct activesheet as well.
Very strange!!

Thanks again!

Kind regards, Bony
--
"There are 10 types of people in this world. Those who understand Binary
and those who don''t ..."


"Peter T" wrote:

Normally that should not changed the Saved property (unless of course
your
Personal is visible and active). Maybe the following will shed some light

Sub Test()
dim wb as Workbook
Set wb = Workbooks("personal.xlsb")
If wb.Saved = False Then
Debug.Print "hmm! reset Saved"
wb.Saved = True
End If
With ActiveWindow
.DisplayWorkbookTabs = Not .DisplayWorkbookTabs
End With
Debug.Print wb.Saved ' ?
Debug.Print ActiveWindow.Parent.Name ' ?
End Sub

Regards,
Peter T

"Bony Pony" wrote in message
...
Hi all,
Does anyone know why the command
ActiveWindow.DisplayWorkbookTabs = True or
ActiveWindow.DisplayWorkbookTabs = False

anywhere in an activeworkbook kicks off the prompt to save a hidden
(and
untouched) Personal.xlsb when Excel is closed?

Kind regards,
Bony
--
"There are 10 types of people in this world. Those who understand
Binary
and those who don''t ..."

--
"There are 10 types of people in this world. Those who understand
Binary
and those who don''t ..."



.





All times are GMT +1. The time now is 01:51 PM.

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