Workbook.activate acts dif when activewindow.caption changed

J

JLGWhiz

The default for Open or Activate for Workbook is to display sheet 1. That is
not an anomaly.
 
K

Ken

jc

I don't think you have a corruption. I see the same unusual
behavior. I am sure it is not something Bill Gates will be interested
in fixing for you; and, you can obviously control the active sheet
though other channels.

Ken
 
K

Ken

The peculiar behavior that jc has noticed is that me.activate selects
sheet1 only after the code that changes the caption is run. If that
line of code is not run, then me.activate does not select sheet1.
After the line of code is run, me.activate will continue to select
sheet1, even if the .caption line is removed, until the file is closed
and reopened. On reopening the file it does not select sheet1 until
the line of code that changes the caption is run. A pretty minor
issue for sure, but, I believe it to be odd nevertheless.

have a nice weekend.

Ken
 
J

jc

Thanks Ken

JC
--
CroceJC


Ken said:
jc

How do you know it is only the second me.activate that changes the
active sheet? It looks like the first one does it for me.

Try this

Sub test()
Me.Activate
MsgBox "what is the active sheet?"
ActiveWindow.Caption = "help xxxxx"
MsgBox "what is the active sheet now?"
Me.Activate
End Sub

Ken
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top