Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 106
Default Msgbox in worksheet activate event if design mode is turned off

Hello all,

Code given below pops up a msgbox whenever any sheet in the workbook is
activated. How to tweak this code to make the msgbox to pop-up only if
design mode is turned off.

Private Sub Workbook_SheetActivate(ByVal sh As Object)
MsgBox "Please check if the design mode is turned off", vbInformation,
"Excel"
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Msgbox in worksheet activate event if design mode is turned off

Events don't fire in design mode anyway.

NickHK

"Thulasiram" wrote in message
oups.com...
Hello all,

Code given below pops up a msgbox whenever any sheet in the workbook is
activated. How to tweak this code to make the msgbox to pop-up only if
design mode is turned off.

Private Sub Workbook_SheetActivate(ByVal sh As Object)
MsgBox "Please check if the design mode is turned off", vbInformation,
"Excel"
End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 106
Default Msgbox in worksheet activate event if design mode is turned off

Nick,

What you have said is true. I think I confused between design mode on
and off. Okay, here is the real situation:

For example, I double click an excel file (that contains macros). While
the file is loaded, design mode is turned off. If the user clicks any
sheet, then I want the msgbox to popup saying that "Please check if the
design mode is turned ON"

I require this because, I have lot of worksheet selection change
events. So, when the user enters any information, I would like to alert
the user by asking him to get into design mode. This will prevent
executing the macros..

Please guide in this issue...

NickHK wrote:
Events don't fire in design mode anyway.

NickHK

"Thulasiram" wrote in message
oups.com...
Hello all,

Code given below pops up a msgbox whenever any sheet in the workbook is
activated. How to tweak this code to make the msgbox to pop-up only if
design mode is turned off.

Private Sub Workbook_SheetActivate(ByVal sh As Object)
MsgBox "Please check if the design mode is turned off", vbInformation,
"Excel"
End Sub


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Msgbox in worksheet activate event if design mode is turned off

When a WB opens, it is not in design Mode.
That MsgBox will prove nothing, as it will only appear if the WB is not in
design mode.

Sounds like you toggle the value of Application.EnableEvents between
true/false, depending if you want the selection change event to fire or not.

NickHK

"Thulasiram" wrote in message
ups.com...
Nick,

What you have said is true. I think I confused between design mode on
and off. Okay, here is the real situation:

For example, I double click an excel file (that contains macros). While
the file is loaded, design mode is turned off. If the user clicks any
sheet, then I want the msgbox to popup saying that "Please check if the
design mode is turned ON"

I require this because, I have lot of worksheet selection change
events. So, when the user enters any information, I would like to alert
the user by asking him to get into design mode. This will prevent
executing the macros..

Please guide in this issue...

NickHK wrote:
Events don't fire in design mode anyway.

NickHK

"Thulasiram" wrote in message
oups.com...
Hello all,

Code given below pops up a msgbox whenever any sheet in the workbook

is
activated. How to tweak this code to make the msgbox to pop-up only if
design mode is turned off.

Private Sub Workbook_SheetActivate(ByVal sh As Object)
MsgBox "Please check if the design mode is turned off", vbInformation,
"Excel"
End Sub




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 106
Default Msgbox in worksheet activate event if design mode is turned off

Nick,

Let me go in your way and try to explain my situation..

When a WB opens, it is not in design Mode. - TRUE
That MsgBox will prove nothing, as it will only appear if the WB is not
in design mode - TRUE again

Okay, I open the WB = design mode is turned off and sheet 1 is
activated.

I click sheet2 and still design mode is off. Macros fire when the
design mode is off. I want the design mode to be turned on. So, now I
have two choices.
1. Write a macro to turn the design mode ON when a sheet is activated
by the user. (I dont know if this could be coded)
2. Else alert the user with a msgbox when the user activates a sheet..

I believe I have made myself clear.. Please provide your expertise.

Thanks..

NickHK wrote:
When a WB opens, it is not in design Mode.
That MsgBox will prove nothing, as it will only appear if the WB is not in
design mode.

Sounds like you toggle the value of Application.EnableEvents between
true/false, depending if you want the selection change event to fire or not.

NickHK

"Thulasiram" wrote in message
ups.com...
Nick,

What you have said is true. I think I confused between design mode on
and off. Okay, here is the real situation:

For example, I double click an excel file (that contains macros). While
the file is loaded, design mode is turned off. If the user clicks any
sheet, then I want the msgbox to popup saying that "Please check if the
design mode is turned ON"

I require this because, I have lot of worksheet selection change
events. So, when the user enters any information, I would like to alert
the user by asking him to get into design mode. This will prevent
executing the macros..

Please guide in this issue...

NickHK wrote:
Events don't fire in design mode anyway.

NickHK

"Thulasiram" wrote in message
oups.com...
Hello all,

Code given below pops up a msgbox whenever any sheet in the workbook

is
activated. How to tweak this code to make the msgbox to pop-up only if
design mode is turned off.

Private Sub Workbook_SheetActivate(ByVal sh As Object)
MsgBox "Please check if the design mode is turned off", vbInformation,
"Excel"
End Sub





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 106
Default Msgbox in worksheet activate event if design mode is turned off

Okay! I understood the situation.. Just tried the exercise in the
workbook and I understood what you were saying Nick.

Thanks for your clarifications so far.. You are right!

Thulasiram wrote:
Nick,

Let me go in your way and try to explain my situation..

When a WB opens, it is not in design Mode. - TRUE
That MsgBox will prove nothing, as it will only appear if the WB is not
in design mode - TRUE again

Okay, I open the WB = design mode is turned off and sheet 1 is
activated.

I click sheet2 and still design mode is off. Macros fire when the
design mode is off. I want the design mode to be turned on. So, now I
have two choices.
1. Write a macro to turn the design mode ON when a sheet is activated
by the user. (I dont know if this could be coded)
2. Else alert the user with a msgbox when the user activates a sheet..

I believe I have made myself clear.. Please provide your expertise.

Thanks..

NickHK wrote:
When a WB opens, it is not in design Mode.
That MsgBox will prove nothing, as it will only appear if the WB is not in
design mode.

Sounds like you toggle the value of Application.EnableEvents between
true/false, depending if you want the selection change event to fire or not.

NickHK

"Thulasiram" wrote in message
ups.com...
Nick,

What you have said is true. I think I confused between design mode on
and off. Okay, here is the real situation:

For example, I double click an excel file (that contains macros). While
the file is loaded, design mode is turned off. If the user clicks any
sheet, then I want the msgbox to popup saying that "Please check if the
design mode is turned ON"

I require this because, I have lot of worksheet selection change
events. So, when the user enters any information, I would like to alert
the user by asking him to get into design mode. This will prevent
executing the macros..

Please guide in this issue...

NickHK wrote:
Events don't fire in design mode anyway.

NickHK

"Thulasiram" wrote in message
oups.com...
Hello all,

Code given below pops up a msgbox whenever any sheet in the workbook

is
activated. How to tweak this code to make the msgbox to pop-up only if
design mode is turned off.

Private Sub Workbook_SheetActivate(ByVal sh As Object)
MsgBox "Please check if the design mode is turned off", vbInformation,
"Excel"
End Sub



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Msgbox in worksheet activate event if design mode is turned off

As you have probably found by now, there is no straight forward way of
forcing design mode in a macro, but events can easily be controlled.
Sometimes you need to look at the situation a different way.

Glad you got the desired result in the end.

NickHK

"Thulasiram" wrote in message
ups.com...
Okay! I understood the situation.. Just tried the exercise in the
workbook and I understood what you were saying Nick.

Thanks for your clarifications so far.. You are right!

Thulasiram wrote:
Nick,

Let me go in your way and try to explain my situation..

When a WB opens, it is not in design Mode. - TRUE
That MsgBox will prove nothing, as it will only appear if the WB is not
in design mode - TRUE again

Okay, I open the WB = design mode is turned off and sheet 1 is
activated.

I click sheet2 and still design mode is off. Macros fire when the
design mode is off. I want the design mode to be turned on. So, now I
have two choices.
1. Write a macro to turn the design mode ON when a sheet is activated
by the user. (I dont know if this could be coded)
2. Else alert the user with a msgbox when the user activates a sheet..

I believe I have made myself clear.. Please provide your expertise.

Thanks..

NickHK wrote:
When a WB opens, it is not in design Mode.
That MsgBox will prove nothing, as it will only appear if the WB is

not in
design mode.

Sounds like you toggle the value of Application.EnableEvents between
true/false, depending if you want the selection change event to fire

or not.

NickHK

"Thulasiram" wrote in message
ups.com...
Nick,

What you have said is true. I think I confused between design mode

on
and off. Okay, here is the real situation:

For example, I double click an excel file (that contains macros).

While
the file is loaded, design mode is turned off. If the user clicks

any
sheet, then I want the msgbox to popup saying that "Please check if

the
design mode is turned ON"

I require this because, I have lot of worksheet selection change
events. So, when the user enters any information, I would like to

alert
the user by asking him to get into design mode. This will prevent
executing the macros..

Please guide in this issue...

NickHK wrote:
Events don't fire in design mode anyway.

NickHK

"Thulasiram" wrote in message
oups.com...
Hello all,

Code given below pops up a msgbox whenever any sheet in the

workbook
is
activated. How to tweak this code to make the msgbox to pop-up

only if
design mode is turned off.

Private Sub Workbook_SheetActivate(ByVal sh As Object)
MsgBox "Please check if the design mode is turned off",

vbInformation,
"Excel"
End Sub





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
Hyperlinks Inserted in Design Mode inactive once Exited Design Mod Craig Excel Programming 0 March 16th 05 04:53 PM
Worksheet Controls in design mode Jared Excel Programming 1 January 25th 05 07:37 PM
Combo Box goes to edit mode even if design mode is in OFF position Chas Excel Discussion (Misc queries) 0 January 7th 05 07:21 PM
MsgBox execution sends program into design mode Jenn Excel Programming 2 April 14th 04 10:21 PM
Enter Excel Design Mode and Exit Design Mode Bill Lunney Excel Programming 0 August 4th 03 07:48 AM


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

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

About Us

"It's about Microsoft Excel"