Puzzling attribute - trying again

  • Thread starter Thread starter Bony Pony
  • Start date Start date
B

Bony Pony

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
 
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
 
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
 
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
 
Back
Top