Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
jc jc is offline
external usenet poster
 
Posts: 164
Default Workbook.activate acts dif when activewindow.caption changed

Normally the active sheet in a workbook doesn't change when the workbook is
activated.

After setting the ActiveWindow.Caption to something new:

Workbook.activate changes the active sheet to Worksheets(1) no matter what
the previous active sheet was.

Can someone confirm this behavior?

Can someone explain this?

Can someone comeup with way to regain normal behavior?
--
JC
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Workbook.activate acts dif when activewindow.caption changed

The activesheet isn't changing on Excel 2003

"jc" wrote:

Normally the active sheet in a workbook doesn't change when the workbook is
activated.

After setting the ActiveWindow.Caption to something new:

Workbook.activate changes the active sheet to Worksheets(1) no matter what
the previous active sheet was.

Can someone confirm this behavior?

Can someone explain this?

Can someone comeup with way to regain normal behavior?
--
JC

  #3   Report Post  
Posted to microsoft.public.excel.programming
jc jc is offline
external usenet poster
 
Posts: 164
Default Workbook.activate acts dif when activewindow.caption changed


I am using EXCEL 2003

Did you set ActiveWindow.Caption to something different first?
--
JC


"Joel" wrote:

The activesheet isn't changing on Excel 2003

"jc" wrote:

Normally the active sheet in a workbook doesn't change when the workbook is
activated.

After setting the ActiveWindow.Caption to something new:

Workbook.activate changes the active sheet to Worksheets(1) no matter what
the previous active sheet was.

Can someone confirm this behavior?

Can someone explain this?

Can someone comeup with way to regain normal behavior?
--
JC

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Workbook.activate acts dif when activewindow.caption changed

I have a one instruction macro which is setting the caption properly. I
tried it with various different sheets being the active sheet with no
changes. Do you have any events macros in your workbook? Try the same thing
from a new workbook and see if the same thing happens.

"jc" wrote:


I am using EXCEL 2003

Did you set ActiveWindow.Caption to something different first?
--
JC


"Joel" wrote:

The activesheet isn't changing on Excel 2003

"jc" wrote:

Normally the active sheet in a workbook doesn't change when the workbook is
activated.

After setting the ActiveWindow.Caption to something new:

Workbook.activate changes the active sheet to Worksheets(1) no matter what
the previous active sheet was.

Can someone confirm this behavior?

Can someone explain this?

Can someone comeup with way to regain normal behavior?
--
JC

  #5   Report Post  
Posted to microsoft.public.excel.programming
jc jc is offline
external usenet poster
 
Posts: 164
Default Workbook.activate acts dif when activewindow.caption changed

I open a new workbook with more than one sheet.
I acitvate a sheet other than sheet(1)
I enter the following code in the workbook code

Sub test()
Me.Activate
ActiveWindow.Caption = "help help"
Me.Activate
End Sub

upon execution:

The first Me.Activate does not change the active sheet

The second Me.Activate changes the active sheet to Sheet(1)

--
JC


"Joel" wrote:

I have a one instruction macro which is setting the caption properly. I
tried it with various different sheets being the active sheet with no
changes. Do you have any events macros in your workbook? Try the same thing
from a new workbook and see if the same thing happens.

"jc" wrote:


I am using EXCEL 2003

Did you set ActiveWindow.Caption to something different first?
--
JC


"Joel" wrote:

The activesheet isn't changing on Excel 2003

"jc" wrote:

Normally the active sheet in a workbook doesn't change when the workbook is
activated.

After setting the ActiveWindow.Caption to something new:

Workbook.activate changes the active sheet to Worksheets(1) no matter what
the previous active sheet was.

Can someone confirm this behavior?

Can someone explain this?

Can someone comeup with way to regain normal behavior?
--
JC



  #6   Report Post  
Posted to microsoft.public.excel.programming
Ken Ken is offline
external usenet poster
 
Posts: 207
Default Workbook.activate acts dif when activewindow.caption changed

jc

I changed the active window caption using the immediate panel in Excel
2003. That does not seem to effect the the activewindow when activate
the workbook for me.

How are you changing the caption? How are you activating the
workbook? There could be something else going on if you are doing
that event code.

Ken

On Jun 12, 2:11*pm, jc wrote:
I am using EXCEL 2003

Did you set ActiveWindow.Caption to something different first?
--
JC



"Joel" wrote:
The activesheet isn't changing on Excel 2003


"jc" wrote:


Normally the active sheet in a workbook doesn't change when the workbook is
activated.


After setting the ActiveWindow.Caption to something new:


Workbook.activate changes the active sheet to Worksheets(1) no matter what
the previous active sheet was.


Can someone confirm this behavior?


Can someone explain this?


Can someone comeup with way to regain normal behavior?
--
JC- Hide quoted text -


- Show quoted text -


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Workbook.activate acts dif when activewindow.caption changed

What does the sheet tab at the bottom read?

"jc" wrote:

I open a new workbook with more than one sheet.
I acitvate a sheet other than sheet(1)
I enter the following code in the workbook code

Sub test()
Me.Activate
ActiveWindow.Caption = "help help"
Me.Activate
End Sub

upon execution:

The first Me.Activate does not change the active sheet

The second Me.Activate changes the active sheet to Sheet(1)

--
JC


"Joel" wrote:

I have a one instruction macro which is setting the caption properly. I
tried it with various different sheets being the active sheet with no
changes. Do you have any events macros in your workbook? Try the same thing
from a new workbook and see if the same thing happens.

"jc" wrote:


I am using EXCEL 2003

Did you set ActiveWindow.Caption to something different first?
--
JC


"Joel" wrote:

The activesheet isn't changing on Excel 2003

"jc" wrote:

Normally the active sheet in a workbook doesn't change when the workbook is
activated.

After setting the ActiveWindow.Caption to something new:

Workbook.activate changes the active sheet to Worksheets(1) no matter what
the previous active sheet was.

Can someone confirm this behavior?

Can someone explain this?

Can someone comeup with way to regain normal behavior?
--
JC

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Workbook.activate acts dif when activewindow.caption changed

The problem isn't the activewindow.caption like you originally said. It is
the Me.Activate. The Me.Activate causes the change to the first worksheet.

"jc" wrote:

I open a new workbook with more than one sheet.
I acitvate a sheet other than sheet(1)
I enter the following code in the workbook code

Sub test()
Me.Activate
ActiveWindow.Caption = "help help"
Me.Activate
End Sub

upon execution:

The first Me.Activate does not change the active sheet

The second Me.Activate changes the active sheet to Sheet(1)

--
JC


"Joel" wrote:

I have a one instruction macro which is setting the caption properly. I
tried it with various different sheets being the active sheet with no
changes. Do you have any events macros in your workbook? Try the same thing
from a new workbook and see if the same thing happens.

"jc" wrote:


I am using EXCEL 2003

Did you set ActiveWindow.Caption to something different first?
--
JC


"Joel" wrote:

The activesheet isn't changing on Excel 2003

"jc" wrote:

Normally the active sheet in a workbook doesn't change when the workbook is
activated.

After setting the ActiveWindow.Caption to something new:

Workbook.activate changes the active sheet to Worksheets(1) no matter what
the previous active sheet was.

Can someone confirm this behavior?

Can someone explain this?

Can someone comeup with way to regain normal behavior?
--
JC

  #9   Report Post  
Posted to microsoft.public.excel.programming
Ken Ken is offline
external usenet poster
 
Posts: 207
Default Workbook.activate acts dif when activewindow.caption changed

jc

Me.activate when run through

Sub test()
Me.Activate
End Sub

which is in the workbook code, activates sheet(1). I would not have
expected that, but, it makes more sense than it being related to the
caption or the second me.activate. Try that and see if you get the
same results.

Ken

On Jun 12, 2:41*pm, jc wrote:
I open a new workbook with more than one sheet.
I acitvate a sheet other than sheet(1)
I enter the following code in the workbook code

Sub test()
Me.Activate
ActiveWindow.Caption = "help help"
Me.Activate
End Sub

upon execution:

The first Me.Activate does not change the active sheet

The second Me.Activate changes the active sheet to Sheet(1)

--
JC



"Joel" wrote:
I have a one instruction macro which is setting the caption properly. *I
tried it with various different sheets being the active sheet with no
changes. *Do you have any events macros in your workbook? *Try the same thing
from a new workbook and see if the same thing happens.


"jc" wrote:


I am using EXCEL 2003


Did you set ActiveWindow.Caption to something different first?
--
JC


"Joel" wrote:


The activesheet isn't changing on Excel 2003


"jc" wrote:


Normally the active sheet in a workbook doesn't change when the workbook is
activated.


After setting the ActiveWindow.Caption to something new:


Workbook.activate changes the active sheet to Worksheets(1) no matter what
the previous active sheet was.


Can someone confirm this behavior?


Can someone explain this?


Can someone comeup with way to regain normal behavior?
--
JC- Hide quoted text -


- Show quoted text -


  #10   Report Post  
Posted to microsoft.public.excel.programming
jc jc is offline
external usenet poster
 
Posts: 164
Default Workbook.activate acts dif when activewindow.caption changed

Again this is the situation

I open a new workbook with more than one sheet.
I acitvate a sheet other than sheet(1)
I enter the following code in the workbook code

Sub test()
Me.Activate
ActiveWindow.Caption = "help help"
Me.Activate
End Sub

upon execution:

The first Me.Activate does not change the active sheet

The second Me.Activate changes the active sheet to Sheet(1)

=========================================

It is not part of an event and it is the me.activate that is changing the
active sheet to the sheet(1) which I believe is not normal behavior.

Can someone please replicate and confirm or deny.
--
JC


"Ken" wrote:

jc

I changed the active window caption using the immediate panel in Excel
2003. That does not seem to effect the the activewindow when activate
the workbook for me.

How are you changing the caption? How are you activating the
workbook? There could be something else going on if you are doing
that event code.

Ken

On Jun 12, 2:11 pm, jc wrote:
I am using EXCEL 2003

Did you set ActiveWindow.Caption to something different first?
--
JC



"Joel" wrote:
The activesheet isn't changing on Excel 2003


"jc" wrote:


Normally the active sheet in a workbook doesn't change when the workbook is
activated.


After setting the ActiveWindow.Caption to something new:


Workbook.activate changes the active sheet to Worksheets(1) no matter what
the previous active sheet was.


Can someone confirm this behavior?


Can someone explain this?


Can someone comeup with way to regain normal behavior?
--
JC- Hide quoted text -


- Show quoted text -





  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Workbook.activate acts dif when activewindow.caption changed

I opened a workbook, put the code in ThisWorkbook to change the caption, Used
a different sub to activate the workbook and in three attemts it did not
change the caption in the title bar from the new title, however, it did in
all cases go back to sheet 1 as the active sheet when the workbook was
activated. Don't know why the OP is getting Worksheets(1) on the title bar
unless he has some odd settings in Excel.

"Ken" wrote:

jc

Me.activate when run through

Sub test()
Me.Activate
End Sub

which is in the workbook code, activates sheet(1). I would not have
expected that, but, it makes more sense than it being related to the
caption or the second me.activate. Try that and see if you get the
same results.

Ken

On Jun 12, 2:41 pm, jc wrote:
I open a new workbook with more than one sheet.
I acitvate a sheet other than sheet(1)
I enter the following code in the workbook code

Sub test()
Me.Activate
ActiveWindow.Caption = "help help"
Me.Activate
End Sub

upon execution:

The first Me.Activate does not change the active sheet

The second Me.Activate changes the active sheet to Sheet(1)

--
JC



"Joel" wrote:
I have a one instruction macro which is setting the caption properly. I
tried it with various different sheets being the active sheet with no
changes. Do you have any events macros in your workbook? Try the same thing
from a new workbook and see if the same thing happens.


"jc" wrote:


I am using EXCEL 2003


Did you set ActiveWindow.Caption to something different first?
--
JC


"Joel" wrote:


The activesheet isn't changing on Excel 2003


"jc" wrote:


Normally the active sheet in a workbook doesn't change when the workbook is
activated.


After setting the ActiveWindow.Caption to something new:


Workbook.activate changes the active sheet to Worksheets(1) no matter what
the previous active sheet was.


Can someone confirm this behavior?


Can someone explain this?


Can someone comeup with way to regain normal behavior?
--
JC- Hide quoted text -


- Show quoted text -



  #12   Report Post  
Posted to microsoft.public.excel.programming
Ken Ken is offline
external usenet poster
 
Posts: 207
Default Workbook.activate acts dif when activewindow.caption changed

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

On Jun 12, 3:01*pm, jc wrote:
Again this is the situation

I open a new workbook with more than one sheet.
I acitvate a sheet other than sheet(1)
I enter the following code in the workbook code

Sub test()
Me.Activate
ActiveWindow.Caption = "help help"
Me.Activate
End Sub

upon execution:

The first Me.Activate does not change the active sheet

The second Me.Activate changes the active sheet to Sheet(1)

=========================================

It is not part of an event and it is the me.activate that is changing the
active sheet to the sheet(1) which I believe is not normal behavior.

Can someone please replicate and confirm or deny.
--
JC



"Ken" wrote:
jc


I changed the active window caption using the immediate panel in Excel
2003. *That does not seem to effect the the activewindow when activate
the workbook for me.


How are you changing the caption? How are you activating the
workbook? *There could be something else going on if you are doing
that event code.


Ken


On Jun 12, 2:11 pm, jc wrote:
I am using EXCEL 2003


Did you set ActiveWindow.Caption to something different first?
--
JC


"Joel" wrote:
The activesheet isn't changing on Excel 2003


"jc" wrote:


Normally the active sheet in a workbook doesn't change when the workbook is
activated.


After setting the ActiveWindow.Caption to something new:


Workbook.activate changes the active sheet to Worksheets(1) no matter what
the previous active sheet was.


Can someone confirm this behavior?


Can someone explain this?


Can someone comeup with way to regain normal behavior?
--
JC- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -


  #13   Report Post  
Posted to microsoft.public.excel.programming
jc jc is offline
external usenet poster
 
Posts: 164
Default Workbook.activate acts dif when activewindow.caption changed

I know by watching it perform.

I think that you may be starting with a workbook where you already reset the
caption.

If you save the workbook as something and reopen it and activate a worksheet
other than Workshee(1) it should perform as I said.

I tried this and It resets to perform again as I initallly stated
--
JC


"Ken" wrote:

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

On Jun 12, 3:01 pm, jc wrote:
Again this is the situation

I open a new workbook with more than one sheet.
I acitvate a sheet other than sheet(1)
I enter the following code in the workbook code

Sub test()
Me.Activate
ActiveWindow.Caption = "help help"
Me.Activate
End Sub

upon execution:

The first Me.Activate does not change the active sheet

The second Me.Activate changes the active sheet to Sheet(1)

=========================================

It is not part of an event and it is the me.activate that is changing the
active sheet to the sheet(1) which I believe is not normal behavior.

Can someone please replicate and confirm or deny.
--
JC



"Ken" wrote:
jc


I changed the active window caption using the immediate panel in Excel
2003. That does not seem to effect the the activewindow when activate
the workbook for me.


How are you changing the caption? How are you activating the
workbook? There could be something else going on if you are doing
that event code.


Ken


On Jun 12, 2:11 pm, jc wrote:
I am using EXCEL 2003


Did you set ActiveWindow.Caption to something different first?
--
JC


"Joel" wrote:
The activesheet isn't changing on Excel 2003


"jc" wrote:


Normally the active sheet in a workbook doesn't change when the workbook is
activated.


After setting the ActiveWindow.Caption to something new:


Workbook.activate changes the active sheet to Worksheets(1) no matter what
the previous active sheet was.


Can someone confirm this behavior?


Can someone explain this?


Can someone comeup with way to regain normal behavior?
--
JC- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -



  #14   Report Post  
Posted to microsoft.public.excel.programming
jc jc is offline
external usenet poster
 
Posts: 164
Default Workbook.activate acts dif when activewindow.caption changed

2 sheets:

"Sheet1" and "Sheet2" put Sheet1 on the left in the sheet1 position.
--
JC


"JLGWhiz" wrote:

What does the sheet tab at the bottom read?

"jc" wrote:

I open a new workbook with more than one sheet.
I acitvate a sheet other than sheet(1)
I enter the following code in the workbook code

Sub test()
Me.Activate
ActiveWindow.Caption = "help help"
Me.Activate
End Sub

upon execution:

The first Me.Activate does not change the active sheet

The second Me.Activate changes the active sheet to Sheet(1)

--
JC


"Joel" wrote:

I have a one instruction macro which is setting the caption properly. I
tried it with various different sheets being the active sheet with no
changes. Do you have any events macros in your workbook? Try the same thing
from a new workbook and see if the same thing happens.

"jc" wrote:


I am using EXCEL 2003

Did you set ActiveWindow.Caption to something different first?
--
JC


"Joel" wrote:

The activesheet isn't changing on Excel 2003

"jc" wrote:

Normally the active sheet in a workbook doesn't change when the workbook is
activated.

After setting the ActiveWindow.Caption to something new:

Workbook.activate changes the active sheet to Worksheets(1) no matter what
the previous active sheet was.

Can someone confirm this behavior?

Can someone explain this?

Can someone comeup with way to regain normal behavior?
--
JC

  #15   Report Post  
Posted to microsoft.public.excel.programming
jc jc is offline
external usenet poster
 
Posts: 164
Default Workbook.activate acts dif when activewindow.caption changed

The first Me.Acitvate doesn't change the active sheet
the second wone does.

Is this normal?
--
JC


"Joel" wrote:

The problem isn't the activewindow.caption like you originally said. It is
the Me.Activate. The Me.Activate causes the change to the first worksheet.

"jc" wrote:

I open a new workbook with more than one sheet.
I acitvate a sheet other than sheet(1)
I enter the following code in the workbook code

Sub test()
Me.Activate
ActiveWindow.Caption = "help help"
Me.Activate
End Sub

upon execution:

The first Me.Activate does not change the active sheet

The second Me.Activate changes the active sheet to Sheet(1)

--
JC


"Joel" wrote:

I have a one instruction macro which is setting the caption properly. I
tried it with various different sheets being the active sheet with no
changes. Do you have any events macros in your workbook? Try the same thing
from a new workbook and see if the same thing happens.

"jc" wrote:


I am using EXCEL 2003

Did you set ActiveWindow.Caption to something different first?
--
JC


"Joel" wrote:

The activesheet isn't changing on Excel 2003

"jc" wrote:

Normally the active sheet in a workbook doesn't change when the workbook is
activated.

After setting the ActiveWindow.Caption to something new:

Workbook.activate changes the active sheet to Worksheets(1) no matter what
the previous active sheet was.

Can someone confirm this behavior?

Can someone explain this?

Can someone comeup with way to regain normal behavior?
--
JC



  #16   Report Post  
Posted to microsoft.public.excel.programming
jc jc is offline
external usenet poster
 
Posts: 164
Default Workbook.activate acts dif when activewindow.caption changed

I don't fully understand what you are saying

In general it appears to me that Setting the window caption

changes the behavior of Workbook.Acitivate in that it causes in all cases
the worksheets(1) to be active instead of the worksheet that was active
priort to running Workbook.Activate.
--
JC


"Ken" wrote:

jc

Me.activate when run through

Sub test()
Me.Activate
End Sub

which is in the workbook code, activates sheet(1). I would not have
expected that, but, it makes more sense than it being related to the
caption or the second me.activate. Try that and see if you get the
same results.

Ken

On Jun 12, 2:41 pm, jc wrote:
I open a new workbook with more than one sheet.
I acitvate a sheet other than sheet(1)
I enter the following code in the workbook code

Sub test()
Me.Activate
ActiveWindow.Caption = "help help"
Me.Activate
End Sub

upon execution:

The first Me.Activate does not change the active sheet

The second Me.Activate changes the active sheet to Sheet(1)

--
JC



"Joel" wrote:
I have a one instruction macro which is setting the caption properly. I
tried it with various different sheets being the active sheet with no
changes. Do you have any events macros in your workbook? Try the same thing
from a new workbook and see if the same thing happens.


"jc" wrote:


I am using EXCEL 2003


Did you set ActiveWindow.Caption to something different first?
--
JC


"Joel" wrote:


The activesheet isn't changing on Excel 2003


"jc" wrote:


Normally the active sheet in a workbook doesn't change when the workbook is
activated.


After setting the ActiveWindow.Caption to something new:


Workbook.activate changes the active sheet to Worksheets(1) no matter what
the previous active sheet was.


Can someone confirm this behavior?


Can someone explain this?


Can someone comeup with way to regain normal behavior?
--
JC- Hide quoted text -


- Show quoted text -



  #17   Report Post  
Posted to microsoft.public.excel.programming
Ken Ken is offline
external usenet poster
 
Posts: 207
Default Workbook.activate acts dif when activewindow.caption changed

jc

This is very strange behavior. If the code below includes the
the .caption line, the active sheet changes; which seems odd; but,
even odder is that is continues to change if the .caption line is
commented out after running once. If the file is opened and run
without the .caption line, it never changes the active sheet. I tried
a couple other activewindow.things and they did not have the same
effect, nor did doing something else in between the two me.activates.

Something about the .caption line makes it lose track of me, but, a
rerunning of the code, with the .caption line commented out after
running with it once, returns the active sheet being the sheet1
immediately, even if you do a bunch of things to another sheet before
running it again.

Sub test()
Me.Activate
MsgBox ActiveSheet.Name
'ActiveWindow.Caption = "xxx"
'ActiveWindow.DisplayGridlines = True
'Cells(1, 1).Value = 5
MsgBox ActiveSheet.Name
Me.Activate
End Sub



On Jun 12, 4:00*pm, jc wrote:
I know by watching it perform.

I think that you may be starting with a workbook where you already reset the
caption.

If you save the workbook as something and reopen it and activate a worksheet
other than Workshee(1) it should perform as I said.

I tried this and It resets to perform again as I initallly stated
--
JC



"Ken" wrote:
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


On Jun 12, 3:01 pm, jc wrote:
Again this is the situation


I open a new workbook with more than one sheet.
I acitvate a sheet other than sheet(1)
I enter the following code in the workbook code


Sub test()
Me.Activate
ActiveWindow.Caption = "help help"
Me.Activate
End Sub


upon execution:


The first Me.Activate does not change the active sheet


The second Me.Activate changes the active sheet to Sheet(1)


=========================================


It is not part of an event and it is the me.activate that is changing the
active sheet to the sheet(1) which I believe is not normal behavior.


Can someone please replicate and confirm or deny.
--
JC


"Ken" wrote:
jc


I changed the active window caption using the immediate panel in Excel
2003. *That does not seem to effect the the activewindow when activate
the workbook for me.


How are you changing the caption? How are you activating the
workbook? *There could be something else going on if you are doing
that event code.


Ken


On Jun 12, 2:11 pm, jc wrote:
I am using EXCEL 2003


Did you set ActiveWindow.Caption to something different first?
--
JC


"Joel" wrote:
The activesheet isn't changing on Excel 2003


"jc" wrote:


Normally the active sheet in a workbook doesn't change when the workbook is
activated.


After setting the ActiveWindow.Caption to something new:


Workbook.activate changes the active sheet to Worksheets(1) no matter what
the previous active sheet was.


Can someone confirm this behavior?


Can someone explain this?


Can someone comeup with way to regain normal behavior?
--
JC- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -


  #18   Report Post  
Posted to microsoft.public.excel.programming
jc jc is offline
external usenet poster
 
Posts: 164
Default Workbook.activate acts dif when activewindow.caption changed

I think you are saying you confirm what I've been saying.

If so is there anything to do about it?

Do you work for Microsoft?

Is there a way to alert them to this apparent bug?
--
JC


"Ken" wrote:

jc

This is very strange behavior. If the code below includes the
the .caption line, the active sheet changes; which seems odd; but,
even odder is that is continues to change if the .caption line is
commented out after running once. If the file is opened and run
without the .caption line, it never changes the active sheet. I tried
a couple other activewindow.things and they did not have the same
effect, nor did doing something else in between the two me.activates.

Something about the .caption line makes it lose track of me, but, a
rerunning of the code, with the .caption line commented out after
running with it once, returns the active sheet being the sheet1
immediately, even if you do a bunch of things to another sheet before
running it again.

Sub test()
Me.Activate
MsgBox ActiveSheet.Name
'ActiveWindow.Caption = "xxx"
'ActiveWindow.DisplayGridlines = True
'Cells(1, 1).Value = 5
MsgBox ActiveSheet.Name
Me.Activate
End Sub



On Jun 12, 4:00 pm, jc wrote:
I know by watching it perform.

I think that you may be starting with a workbook where you already reset the
caption.

If you save the workbook as something and reopen it and activate a worksheet
other than Workshee(1) it should perform as I said.

I tried this and It resets to perform again as I initallly stated
--
JC



"Ken" wrote:
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


On Jun 12, 3:01 pm, jc wrote:
Again this is the situation


I open a new workbook with more than one sheet.
I acitvate a sheet other than sheet(1)
I enter the following code in the workbook code


Sub test()
Me.Activate
ActiveWindow.Caption = "help help"
Me.Activate
End Sub


upon execution:


The first Me.Activate does not change the active sheet


The second Me.Activate changes the active sheet to Sheet(1)


=========================================


It is not part of an event and it is the me.activate that is changing the
active sheet to the sheet(1) which I believe is not normal behavior.


Can someone please replicate and confirm or deny.
--
JC


"Ken" wrote:
jc


I changed the active window caption using the immediate panel in Excel
2003. That does not seem to effect the the activewindow when activate
the workbook for me.


How are you changing the caption? How are you activating the
workbook? There could be something else going on if you are doing
that event code.


Ken


On Jun 12, 2:11 pm, jc wrote:
I am using EXCEL 2003


Did you set ActiveWindow.Caption to something different first?
--
JC


"Joel" wrote:
The activesheet isn't changing on Excel 2003


"jc" wrote:


Normally the active sheet in a workbook doesn't change when the workbook is
activated.


After setting the ActiveWindow.Caption to something new:


Workbook.activate changes the active sheet to Worksheets(1) no matter what
the previous active sheet was.


Can someone confirm this behavior?


Can someone explain this?


Can someone comeup with way to regain normal behavior?
--
JC- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -



  #19   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Workbook.activate acts dif when activewindow.caption changed

Most folks name a new workbook when they create it and then save it. Those
folks would never see the phenomenon that you are experiencing. I am even
having a hard time duplicating your finding. I have tried creating a new
workbook, changing the window caption and then using the me.activate command.
It does not change the caption. Even if it did, I would not get very
excited, I can always set the name right when I save it, because it will
automatically bring up the SaveAs dialog box and it can be corrected at that
time. I don't believe Microsoft would be too concerned about the anomaly.

"jc" wrote:

I think you are saying you confirm what I've been saying.

If so is there anything to do about it?

Do you work for Microsoft?

Is there a way to alert them to this apparent bug?
--
JC


"Ken" wrote:

jc

This is very strange behavior. If the code below includes the
the .caption line, the active sheet changes; which seems odd; but,
even odder is that is continues to change if the .caption line is
commented out after running once. If the file is opened and run
without the .caption line, it never changes the active sheet. I tried
a couple other activewindow.things and they did not have the same
effect, nor did doing something else in between the two me.activates.

Something about the .caption line makes it lose track of me, but, a
rerunning of the code, with the .caption line commented out after
running with it once, returns the active sheet being the sheet1
immediately, even if you do a bunch of things to another sheet before
running it again.

Sub test()
Me.Activate
MsgBox ActiveSheet.Name
'ActiveWindow.Caption = "xxx"
'ActiveWindow.DisplayGridlines = True
'Cells(1, 1).Value = 5
MsgBox ActiveSheet.Name
Me.Activate
End Sub



On Jun 12, 4:00 pm, jc wrote:
I know by watching it perform.

I think that you may be starting with a workbook where you already reset the
caption.

If you save the workbook as something and reopen it and activate a worksheet
other than Workshee(1) it should perform as I said.

I tried this and It resets to perform again as I initallly stated
--
JC



"Ken" wrote:
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

On Jun 12, 3:01 pm, jc wrote:
Again this is the situation

I open a new workbook with more than one sheet.
I acitvate a sheet other than sheet(1)
I enter the following code in the workbook code

Sub test()
Me.Activate
ActiveWindow.Caption = "help help"
Me.Activate
End Sub

upon execution:

The first Me.Activate does not change the active sheet

The second Me.Activate changes the active sheet to Sheet(1)

=========================================

It is not part of an event and it is the me.activate that is changing the
active sheet to the sheet(1) which I believe is not normal behavior.

Can someone please replicate and confirm or deny.
--
JC

"Ken" wrote:
jc

I changed the active window caption using the immediate panel in Excel
2003. That does not seem to effect the the activewindow when activate
the workbook for me.

How are you changing the caption? How are you activating the
workbook? There could be something else going on if you are doing
that event code.

Ken

On Jun 12, 2:11 pm, jc wrote:
I am using EXCEL 2003

Did you set ActiveWindow.Caption to something different first?
--
JC

"Joel" wrote:
The activesheet isn't changing on Excel 2003

"jc" wrote:

Normally the active sheet in a workbook doesn't change when the workbook is
activated.

After setting the ActiveWindow.Caption to something new:

Workbook.activate changes the active sheet to Worksheets(1) no matter what
the previous active sheet was.

Can someone confirm this behavior?

Can someone explain this?

Can someone comeup with way to regain normal behavior?
--
JC- Hide quoted text -

- Show quoted text -- Hide quoted text -

- Show quoted text -- Hide quoted text -

- Show quoted text -



  #20   Report Post  
Posted to microsoft.public.excel.programming
jc jc is offline
external usenet poster
 
Posts: 164
Default Workbook.activate acts dif when activewindow.caption changed

My main concern is to have someone duplicate what is happening to me so that
I know that I don't have a corrupted macro file. I'm creating lots of
simalar workbooks in a loop that I don't need to save but the user does see
while they are creating. I'm trying to get away without saving each file
(Save time and file space). When you say you're having trouble duplicating
my finding (that the caption doesn't change with me.activate), this is not
what I said I was noticing. I noticed that the activation of the workbook
will change the active sheet to sheets(1). If there is no other underlying
problem I can activate the sheet I need. I wonder though if there is and
underlying problem that will crop up.
--
JC


"JLGWhiz" wrote:

Most folks name a new workbook when they create it and then save it. Those
folks would never see the phenomenon that you are experiencing. I am even
having a hard time duplicating your finding. I have tried creating a new
workbook, changing the window caption and then using the me.activate command.
It does not change the caption. Even if it did, I would not get very
excited, I can always set the name right when I save it, because it will
automatically bring up the SaveAs dialog box and it can be corrected at that
time. I don't believe Microsoft would be too concerned about the anomaly.

"jc" wrote:

I think you are saying you confirm what I've been saying.

If so is there anything to do about it?

Do you work for Microsoft?

Is there a way to alert them to this apparent bug?
--
JC


"Ken" wrote:

jc

This is very strange behavior. If the code below includes the
the .caption line, the active sheet changes; which seems odd; but,
even odder is that is continues to change if the .caption line is
commented out after running once. If the file is opened and run
without the .caption line, it never changes the active sheet. I tried
a couple other activewindow.things and they did not have the same
effect, nor did doing something else in between the two me.activates.

Something about the .caption line makes it lose track of me, but, a
rerunning of the code, with the .caption line commented out after
running with it once, returns the active sheet being the sheet1
immediately, even if you do a bunch of things to another sheet before
running it again.

Sub test()
Me.Activate
MsgBox ActiveSheet.Name
'ActiveWindow.Caption = "xxx"
'ActiveWindow.DisplayGridlines = True
'Cells(1, 1).Value = 5
MsgBox ActiveSheet.Name
Me.Activate
End Sub



On Jun 12, 4:00 pm, jc wrote:
I know by watching it perform.

I think that you may be starting with a workbook where you already reset the
caption.

If you save the workbook as something and reopen it and activate a worksheet
other than Workshee(1) it should perform as I said.

I tried this and It resets to perform again as I initallly stated
--
JC



"Ken" wrote:
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

On Jun 12, 3:01 pm, jc wrote:
Again this is the situation

I open a new workbook with more than one sheet.
I acitvate a sheet other than sheet(1)
I enter the following code in the workbook code

Sub test()
Me.Activate
ActiveWindow.Caption = "help help"
Me.Activate
End Sub

upon execution:

The first Me.Activate does not change the active sheet

The second Me.Activate changes the active sheet to Sheet(1)

=========================================

It is not part of an event and it is the me.activate that is changing the
active sheet to the sheet(1) which I believe is not normal behavior.

Can someone please replicate and confirm or deny.
--
JC

"Ken" wrote:
jc

I changed the active window caption using the immediate panel in Excel
2003. That does not seem to effect the the activewindow when activate
the workbook for me.

How are you changing the caption? How are you activating the
workbook? There could be something else going on if you are doing
that event code.

Ken

On Jun 12, 2:11 pm, jc wrote:
I am using EXCEL 2003

Did you set ActiveWindow.Caption to something different first?
--
JC

"Joel" wrote:
The activesheet isn't changing on Excel 2003

"jc" wrote:

Normally the active sheet in a workbook doesn't change when the workbook is
activated.

After setting the ActiveWindow.Caption to something new:

Workbook.activate changes the active sheet to Worksheets(1) no matter what
the previous active sheet was.

Can someone confirm this behavior?

Can someone explain this?

Can someone comeup with way to regain normal behavior?
--
JC- Hide quoted text -

- Show quoted text -- Hide quoted text -

- Show quoted text -- Hide quoted text -

- Show quoted text -




  #21   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Workbook.activate acts dif when activewindow.caption changed

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

"jc" wrote:

My main concern is to have someone duplicate what is happening to me so that
I know that I don't have a corrupted macro file. I'm creating lots of
simalar workbooks in a loop that I don't need to save but the user does see
while they are creating. I'm trying to get away without saving each file
(Save time and file space). When you say you're having trouble duplicating
my finding (that the caption doesn't change with me.activate), this is not
what I said I was noticing. I noticed that the activation of the workbook
will change the active sheet to sheets(1). If there is no other underlying
problem I can activate the sheet I need. I wonder though if there is and
underlying problem that will crop up.
--
JC


"JLGWhiz" wrote:

Most folks name a new workbook when they create it and then save it. Those
folks would never see the phenomenon that you are experiencing. I am even
having a hard time duplicating your finding. I have tried creating a new
workbook, changing the window caption and then using the me.activate command.
It does not change the caption. Even if it did, I would not get very
excited, I can always set the name right when I save it, because it will
automatically bring up the SaveAs dialog box and it can be corrected at that
time. I don't believe Microsoft would be too concerned about the anomaly.

"jc" wrote:

I think you are saying you confirm what I've been saying.

If so is there anything to do about it?

Do you work for Microsoft?

Is there a way to alert them to this apparent bug?
--
JC


"Ken" wrote:

jc

This is very strange behavior. If the code below includes the
the .caption line, the active sheet changes; which seems odd; but,
even odder is that is continues to change if the .caption line is
commented out after running once. If the file is opened and run
without the .caption line, it never changes the active sheet. I tried
a couple other activewindow.things and they did not have the same
effect, nor did doing something else in between the two me.activates.

Something about the .caption line makes it lose track of me, but, a
rerunning of the code, with the .caption line commented out after
running with it once, returns the active sheet being the sheet1
immediately, even if you do a bunch of things to another sheet before
running it again.

Sub test()
Me.Activate
MsgBox ActiveSheet.Name
'ActiveWindow.Caption = "xxx"
'ActiveWindow.DisplayGridlines = True
'Cells(1, 1).Value = 5
MsgBox ActiveSheet.Name
Me.Activate
End Sub



On Jun 12, 4:00 pm, jc wrote:
I know by watching it perform.

I think that you may be starting with a workbook where you already reset the
caption.

If you save the workbook as something and reopen it and activate a worksheet
other than Workshee(1) it should perform as I said.

I tried this and It resets to perform again as I initallly stated
--
JC



"Ken" wrote:
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

On Jun 12, 3:01 pm, jc wrote:
Again this is the situation

I open a new workbook with more than one sheet.
I acitvate a sheet other than sheet(1)
I enter the following code in the workbook code

Sub test()
Me.Activate
ActiveWindow.Caption = "help help"
Me.Activate
End Sub

upon execution:

The first Me.Activate does not change the active sheet

The second Me.Activate changes the active sheet to Sheet(1)

=========================================

It is not part of an event and it is the me.activate that is changing the
active sheet to the sheet(1) which I believe is not normal behavior.

Can someone please replicate and confirm or deny.
--
JC

"Ken" wrote:
jc

I changed the active window caption using the immediate panel in Excel
2003. That does not seem to effect the the activewindow when activate
the workbook for me.

How are you changing the caption? How are you activating the
workbook? There could be something else going on if you are doing
that event code.

Ken

On Jun 12, 2:11 pm, jc wrote:
I am using EXCEL 2003

Did you set ActiveWindow.Caption to something different first?
--
JC

"Joel" wrote:
The activesheet isn't changing on Excel 2003

"jc" wrote:

Normally the active sheet in a workbook doesn't change when the workbook is
activated.

After setting the ActiveWindow.Caption to something new:

Workbook.activate changes the active sheet to Worksheets(1) no matter what
the previous active sheet was.

Can someone confirm this behavior?

Can someone explain this?

Can someone comeup with way to regain normal behavior?
--
JC- Hide quoted text -

- Show quoted text -- Hide quoted text -

- Show quoted text -- Hide quoted text -

- Show quoted text -


  #22   Report Post  
Posted to microsoft.public.excel.programming
Ken Ken is offline
external usenet poster
 
Posts: 207
Default Workbook.activate acts dif when activewindow.caption changed

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



On Jun 13, 9:02*am, jc wrote:
My main concern is to have someone duplicate what is happening to me so that
I know that I don't have a corrupted macro file. *I'm creating lots of
simalar workbooks in a loop that I don't need to save but the user does see
while they are creating. *I'm trying to get away without saving each file
(Save time and file space). *When you say you're having trouble duplicating
my finding (that the caption doesn't change with me.activate), this is not
what I said I was noticing. *I noticed that the activation of the workbook
will change the active sheet to sheets(1). *If there is no other underlying
problem I can activate the sheet I need. *I wonder though if there is and
underlying problem that will crop up.
--
JC



"JLGWhiz" wrote:
Most folks name a new workbook when they create it and then save it. *Those
folks would never see the phenomenon that you are experiencing. *I am even
having a hard time duplicating your finding. *I have tried creating a new
workbook, changing the window caption and then using the me.activate command.
*It does not change the caption. *Even if it did, I would not get very
excited, I can always set the name right when I save it, because it will
automatically bring up the SaveAs dialog box and it can be corrected at that
time. *I don't believe Microsoft would be too concerned about the anomaly.


"jc" wrote:


I think you are saying you confirm what I've been saying.


If so is there anything to do about it?


Do you work for Microsoft?


Is there a way to alert them to this apparent bug?
--
JC


"Ken" wrote:


jc


This is very strange behavior. *If the code below includes the
the .caption line, the active sheet changes; which seems odd; but,
even odder is that is continues to change if the .caption line is
commented out after running once. *If the file is opened and run
without the .caption line, it never changes the active sheet. *I tried
a couple other activewindow.things and they did not have the same
effect, nor did doing something else in between the two me.activates..


Something about the .caption line makes it lose track of me, but, a
rerunning of the code, with the .caption line commented out after
running with it once, returns the active sheet being the sheet1
immediately, even if you do a bunch of things to another sheet before
running it again.


Sub test()
Me.Activate
MsgBox ActiveSheet.Name
'ActiveWindow.Caption = "xxx"
'ActiveWindow.DisplayGridlines = True
'Cells(1, 1).Value = 5
MsgBox ActiveSheet.Name
Me.Activate
End Sub


On Jun 12, 4:00 pm, jc wrote:
I know by watching it perform.


I think that you may be starting with a workbook where you already reset the
caption.


If you save the workbook as something and reopen it and activate a worksheet
other than Workshee(1) it should perform as I said.


I tried this and It resets to perform again as I initallly stated
--
JC


"Ken" wrote:
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


On Jun 12, 3:01 pm, jc wrote:
Again this is the situation


I open a new workbook with more than one sheet.
I acitvate a sheet other than sheet(1)
I enter the following code in the workbook code


Sub test()
Me.Activate
ActiveWindow.Caption = "help help"
Me.Activate
End Sub


upon execution:


The first Me.Activate does not change the active sheet


The second Me.Activate changes the active sheet to Sheet(1)


=========================================


It is not part of an event and it is the me.activate that is changing the
active sheet to the sheet(1) which I believe is not normal behavior.


Can someone please replicate and confirm or deny.
--
JC


"Ken" wrote:
jc


I changed the active window caption using the immediate panel in Excel
2003. *That does not seem to effect the the activewindow when activate
the workbook for me.


How are you changing the caption? How are you activating the
workbook? *There could be something else going on if you are doing
that event code.


Ken


On Jun 12, 2:11 pm, jc wrote:
I am using EXCEL 2003


Did you set ActiveWindow.Caption to something different first?
--
JC


"Joel" wrote:
The activesheet isn't changing on Excel 2003


"jc" wrote:


Normally the active sheet in a workbook doesn't change when the workbook is
activated.


After setting the ActiveWindow.Caption to something new:


Workbook.activate changes the active sheet to Worksheets(1) no matter what
the previous active sheet was.


Can someone confirm this behavior?


Can someone explain this?


Can someone comeup with way to regain normal behavior?
--
JC- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -


  #23   Report Post  
Posted to microsoft.public.excel.programming
Ken Ken is offline
external usenet poster
 
Posts: 207
Default Workbook.activate acts dif when activewindow.caption changed

On Jun 13, 11:59*am, JLGWhiz
wrote:
The default for Open or Activate for Workbook is to display sheet 1. *That is
not an anomaly.



"jc" wrote:
My main concern is to have someone duplicate what is happening to me so that
I know that I don't have a corrupted macro file. *I'm creating lots of
simalar workbooks in a loop that I don't need to save but the user does see
while they are creating. *I'm trying to get away without saving each file
(Save time and file space). *When you say you're having trouble duplicating
my finding (that the caption doesn't change with me.activate), this is not
what I said I was noticing. *I noticed that the activation of the workbook
will change the active sheet to sheets(1). *If there is no other underlying
problem I can activate the sheet I need. *I wonder though if there is and
underlying problem that will crop up.
--
JC


"JLGWhiz" wrote:


Most folks name a new workbook when they create it and then save it. *Those
folks would never see the phenomenon that you are experiencing. *I am even
having a hard time duplicating your finding. *I have tried creating a new
workbook, changing the window caption and then using the me.activate command.
*It does not change the caption. *Even if it did, I would not get very
excited, I can always set the name right when I save it, because it will
automatically bring up the SaveAs dialog box and it can be corrected at that
time. *I don't believe Microsoft would be too concerned about the anomaly.


"jc" wrote:


I think you are saying you confirm what I've been saying.


If so is there anything to do about it?


Do you work for Microsoft?


Is there a way to alert them to this apparent bug?
--
JC


"Ken" wrote:


jc


This is very strange behavior. *If the code below includes the
the .caption line, the active sheet changes; which seems odd; but,
even odder is that is continues to change if the .caption line is
commented out after running once. *If the file is opened and run
without the .caption line, it never changes the active sheet. *I tried
a couple other activewindow.things and they did not have the same
effect, nor did doing something else in between the two me.activates.


Something about the .caption line makes it lose track of me, but, a
rerunning of the code, with the .caption line commented out after
running with it once, returns the active sheet being the sheet1
immediately, even if you do a bunch of things to another sheet before
running it again.


Sub test()
Me.Activate
MsgBox ActiveSheet.Name
'ActiveWindow.Caption = "xxx"
'ActiveWindow.DisplayGridlines = True
'Cells(1, 1).Value = 5
MsgBox ActiveSheet.Name
Me.Activate
End Sub


On Jun 12, 4:00 pm, jc wrote:
I know by watching it perform.


I think that you may be starting with a workbook where you already reset the
caption.


If you save the workbook as something and reopen it and activate a worksheet
other than Workshee(1) it should perform as I said.


I tried this and It resets to perform again as I initallly stated
--
JC


"Ken" wrote:
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


On Jun 12, 3:01 pm, jc wrote:
Again this is the situation


I open a new workbook with more than one sheet.
I acitvate a sheet other than sheet(1)
I enter the following code in the workbook code


Sub test()
Me.Activate
ActiveWindow.Caption = "help help"
Me.Activate
End Sub


upon execution:


The first Me.Activate does not change the active sheet


The second Me.Activate changes the active sheet to Sheet(1)


=========================================


It is not part of an event and it is the me.activate that is changing the
active sheet to the sheet(1) which I believe is not normal behavior.


Can someone please replicate and confirm or deny.
--
JC


"Ken" wrote:
jc


I changed the active window caption using the immediate panel in Excel
2003. *That does not seem to effect the the activewindow when activate
the workbook for me.


How are you changing the caption? How are you activating the
workbook? *There could be something else going on if you are doing
that event code.


Ken


On Jun 12, 2:11 pm, jc wrote:
I am using EXCEL 2003


Did you set ActiveWindow.Caption to something different first?
--
JC


"Joel" wrote:
The activesheet isn't changing on Excel 2003


"jc" wrote:


Normally the active sheet in a workbook doesn't change when the workbook is
activated.


After setting the ActiveWindow.Caption to something new:


Workbook.activate changes the active sheet to Worksheets(1) no matter what
the previous active sheet was.


Can someone confirm this behavior?


Can someone explain this?


Can someone comeup with way to regain normal behavior?
--
JC- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -


  #24   Report Post  
Posted to microsoft.public.excel.programming
Ken Ken is offline
external usenet poster
 
Posts: 207
Default Workbook.activate acts dif when activewindow.caption changed

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



On Jun 13, 11:59*am, JLGWhiz
wrote:
The default for Open or Activate for Workbook is to display sheet 1. *That is
not an anomaly.



"jc" wrote:
My main concern is to have someone duplicate what is happening to me so that
I know that I don't have a corrupted macro file. *I'm creating lots of
simalar workbooks in a loop that I don't need to save but the user does see
while they are creating. *I'm trying to get away without saving each file
(Save time and file space). *When you say you're having trouble duplicating
my finding (that the caption doesn't change with me.activate), this is not
what I said I was noticing. *I noticed that the activation of the workbook
will change the active sheet to sheets(1). *If there is no other underlying
problem I can activate the sheet I need. *I wonder though if there is and
underlying problem that will crop up.
--
JC


"JLGWhiz" wrote:


Most folks name a new workbook when they create it and then save it. *Those
folks would never see the phenomenon that you are experiencing. *I am even
having a hard time duplicating your finding. *I have tried creating a new
workbook, changing the window caption and then using the me.activate command.
*It does not change the caption. *Even if it did, I would not get very
excited, I can always set the name right when I save it, because it will
automatically bring up the SaveAs dialog box and it can be corrected at that
time. *I don't believe Microsoft would be too concerned about the anomaly.


"jc" wrote:


I think you are saying you confirm what I've been saying.


If so is there anything to do about it?


Do you work for Microsoft?


Is there a way to alert them to this apparent bug?
--
JC


"Ken" wrote:


jc


This is very strange behavior. *If the code below includes the
the .caption line, the active sheet changes; which seems odd; but,
even odder is that is continues to change if the .caption line is
commented out after running once. *If the file is opened and run
without the .caption line, it never changes the active sheet. *I tried
a couple other activewindow.things and they did not have the same
effect, nor did doing something else in between the two me.activates.


Something about the .caption line makes it lose track of me, but, a
rerunning of the code, with the .caption line commented out after
running with it once, returns the active sheet being the sheet1
immediately, even if you do a bunch of things to another sheet before
running it again.


Sub test()
Me.Activate
MsgBox ActiveSheet.Name
'ActiveWindow.Caption = "xxx"
'ActiveWindow.DisplayGridlines = True
'Cells(1, 1).Value = 5
MsgBox ActiveSheet.Name
Me.Activate
End Sub


On Jun 12, 4:00 pm, jc wrote:
I know by watching it perform.


I think that you may be starting with a workbook where you already reset the
caption.


If you save the workbook as something and reopen it and activate a worksheet
other than Workshee(1) it should perform as I said.


I tried this and It resets to perform again as I initallly stated
--
JC


"Ken" wrote:
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


On Jun 12, 3:01 pm, jc wrote:
Again this is the situation


I open a new workbook with more than one sheet.
I acitvate a sheet other than sheet(1)
I enter the following code in the workbook code


Sub test()
Me.Activate
ActiveWindow.Caption = "help help"
Me.Activate
End Sub


upon execution:


The first Me.Activate does not change the active sheet


The second Me.Activate changes the active sheet to Sheet(1)


=========================================


It is not part of an event and it is the me.activate that is changing the
active sheet to the sheet(1) which I believe is not normal behavior.


Can someone please replicate and confirm or deny.
--
JC


"Ken" wrote:
jc


I changed the active window caption using the immediate panel in Excel
2003. *That does not seem to effect the the activewindow when activate
the workbook for me.


How are you changing the caption? How are you activating the
workbook? *There could be something else going on if you are doing
that event code.


Ken


On Jun 12, 2:11 pm, jc wrote:
I am using EXCEL 2003


Did you set ActiveWindow.Caption to something different first?
--
JC


"Joel" wrote:
The activesheet isn't changing on Excel 2003


"jc" wrote:


Normally the active sheet in a workbook doesn't change when the workbook is
activated.


After setting the ActiveWindow.Caption to something new:


Workbook.activate changes the active sheet to Worksheets(1) no matter what
the previous active sheet was.


Can someone confirm this behavior?


Can someone explain this?


Can someone comeup with way to regain normal behavior?
--
JC- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -


  #25   Report Post  
Posted to microsoft.public.excel.programming
jc jc is offline
external usenet poster
 
Posts: 164
Default Workbook.activate acts dif when activewindow.caption changed

Thanks Ken

JC
--
CroceJC


"Ken" wrote:

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

On Jun 12, 3:01 pm, jc wrote:
Again this is the situation

I open a new workbook with more than one sheet.
I acitvate a sheet other than sheet(1)
I enter the following code in the workbook code

Sub test()
Me.Activate
ActiveWindow.Caption = "help help"
Me.Activate
End Sub

upon execution:

The first Me.Activate does not change the active sheet

The second Me.Activate changes the active sheet to Sheet(1)

=========================================

It is not part of an event and it is the me.activate that is changing the
active sheet to the sheet(1) which I believe is not normal behavior.

Can someone please replicate and confirm or deny.
--
JC



"Ken" wrote:
jc


I changed the active window caption using the immediate panel in Excel
2003. That does not seem to effect the the activewindow when activate
the workbook for me.


How are you changing the caption? How are you activating the
workbook? There could be something else going on if you are doing
that event code.


Ken


On Jun 12, 2:11 pm, jc wrote:
I am using EXCEL 2003


Did you set ActiveWindow.Caption to something different first?
--
JC


"Joel" wrote:
The activesheet isn't changing on Excel 2003


"jc" wrote:


Normally the active sheet in a workbook doesn't change when the workbook is
activated.


After setting the ActiveWindow.Caption to something new:


Workbook.activate changes the active sheet to Worksheets(1) no matter what
the previous active sheet was.


Can someone confirm this behavior?


Can someone explain this?


Can someone comeup with way to regain normal behavior?
--
JC- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Activate speech when sheet is changed faureman via OfficeKB.com Excel Programming 2 August 25th 07 12:02 AM
Can Multiple Range Pivot Table's field button's caption be changed Jac Excel Discussion (Misc queries) 1 June 10th 07 11:09 AM
Change Worksheet Button Caption on Worksheet.Activate MikeZz Excel Programming 1 December 7th 06 06:01 AM
Workbook.Activate / Window.Activate problem Tim[_44_] Excel Programming 3 February 3rd 06 11:38 PM
How can the caption of a (button) shape (not cmd) be changed from VBA AnExpertNovice Excel Programming 7 December 7th 05 06:20 PM


All times are GMT +1. The time now is 03:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"