Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Suppressing Msgbox during Testing

Can't you just put a ' infront of the code you don't want
to be executed, thus making it a comment while you don't
want it to run.
-----Original Message-----
Hi

Please can someone provide a code snipprt or an idea to

solve this neatly

I have a utility that does some predetermined formatting

on generic
worksheets. In normal use it is used on ONE sheet at a

time by the user.
S/he may then use it later on another sheet.

I want to test modifications against a set of sheets in a

workbook
consecutively in one go, which is fine but the routine

itself has a MSGBOX
command in it if it finds a particalar condition. I need

to suppress this in
the multi-sheet test. Otherwise it will be stopping

unnecessarily as I would
test that Msgbox condition independently.

Can someone provide a suggestion,pl?

Pl post back if above is not clear enough to enable a

response.

Thanks

Tim




.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 128
Default Suppressing Msgbox during Testing

Hi

thanks for those ideas...the reservations about these methods are they stop
me being able to see what will happen if I am a user - I think it is risky
to assume things will always work as you expect* that is why I want to turn
the msgbox off just for the multi-sheet test. Commenting out the code is
risky as I may not remember to uncomment it.

Thanks

Tim

* I am often wrong-footed esp. as the complexity of interaction of differnet
parameters increases


"libby" wrote in message
...
Can't you just put a ' infront of the code you don't want
to be executed, thus making it a comment while you don't
want it to run.
-----Original Message-----
Hi

Please can someone provide a code snipprt or an idea to

solve this neatly

I have a utility that does some predetermined formatting

on generic
worksheets. In normal use it is used on ONE sheet at a

time by the user.
S/he may then use it later on another sheet.

I want to test modifications against a set of sheets in a

workbook
consecutively in one go, which is fine but the routine

itself has a MSGBOX
command in it if it finds a particalar condition. I need

to suppress this in
the multi-sheet test. Otherwise it will be stopping

unnecessarily as I would
test that Msgbox condition independently.

Can someone provide a suggestion,pl?

Pl post back if above is not clear enough to enable a

response.

Thanks

Tim




.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default Suppressing Msgbox during Testing

Tim,

If you use the method to manually set a TestMode variable to true
you can easily switch between the two modes.
When working on "live" workbooks I usually use it in the following way:

Sub TestMe()
' code that I know works
End Sub

If I'm trying to modify or enhance the code I do this with that same
module:

Sub TestMe()
If TestMode = False Then
' code that I know works
Else
' modified code that I'm testing
End If
End Sub

Whenever I'm working on the workbook, I can set TestMode to True
and do whatever I want with it. Since I have to manually set it to test,
I never have to worry about the user running into my untested code
and I can test it as a regular user myself.
When I'm happy that everything works well, I just delete the if statements
and my old code.

I do the same for UserForms too.
Place a button on the form to test some code, but set the button
invisible IF TestMode = False.

With the above method, whenever I have to release the workbook for someone
else to use it, I don't have to worry about what I may heve left in there
or was in the middle of when I save and close it.

John



Tim Childs wrote:

Hi

thanks for those ideas...the reservations about these methods are they stop
me being able to see what will happen if I am a user - I think it is risky
to assume things will always work as you expect* that is why I want to turn
the msgbox off just for the multi-sheet test. Commenting out the code is
risky as I may not remember to uncomment it.

Thanks

Tim

* I am often wrong-footed esp. as the complexity of interaction of differnet
parameters increases

"libby" wrote in message
...
Can't you just put a ' infront of the code you don't want
to be executed, thus making it a comment while you don't
want it to run.
-----Original Message-----
Hi

Please can someone provide a code snipprt or an idea to

solve this neatly

I have a utility that does some predetermined formatting

on generic
worksheets. In normal use it is used on ONE sheet at a

time by the user.
S/he may then use it later on another sheet.

I want to test modifications against a set of sheets in a

workbook
consecutively in one go, which is fine but the routine

itself has a MSGBOX
command in it if it finds a particalar condition. I need

to suppress this in
the multi-sheet test. Otherwise it will be stopping

unnecessarily as I would
test that Msgbox condition independently.

Can someone provide a suggestion,pl?

Pl post back if above is not clear enough to enable a

response.

Thanks

Tim




.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 128
Default Suppressing Msgbox during Testing

John

Many thanks for coming back with this further ost and explanation - I will
try it out in my context

Best wishes

Tim


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
Suppressing detail rows da Excel Discussion (Misc queries) 1 January 13th 09 12:59 AM
Suppressing Decmal zero's neil40 Excel Discussion (Misc queries) 7 April 24th 07 01:02 AM
Hi all!! Suppressing the "Do you want to save changes" Bony Pony Excel Worksheet Functions 2 February 2nd 05 11:39 AM
suppressing the splash screen bullseye Excel Discussion (Misc queries) 4 January 5th 05 05:39 PM
Suppressing Msgbox during Testing John Wilson Excel Programming 0 August 7th 03 06:59 PM


All times are GMT +1. The time now is 02:52 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"