Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Ignore MsgBox if run by automation

My suggestion would be to make a function that takes an argument and does
everything you want it to ie:
Private Function MyFunction(Send as Boolean)
code . . .
If Send = True then
code to send . . .
End If
code . . .
End Function

Then for your button
Private Sub myButton_Click()
If MsgBox("Do you want to send this report?", vbYesNo) = vbYes Then
MyFunction Send:=TRUE
Else
MyFunction Send:=FALSE
End If
End Sub

For your other code
MyFunction Send:=TRUE

Dan E

"Tod" wrote in message
...
I have something like this:

If MsgBox("Do you want to send this report?", vbYesNo) =
vbYes Then
'Code to send report
End If

When the code is being executed from a button on the
worksheet, it will give the user the choice. However, I
also have a script that opens this workbook each morning
and runs the same procedure. Is there a way I can have the
procedure know it's being run by a script and accept the
default (which I think is Yes)?

tod



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
msgbox muddan madhu Excel Worksheet Functions 2 April 14th 08 05:06 AM
VB - ignore a msgbox prompt Kevin Excel Discussion (Misc queries) 3 January 10th 08 11:47 AM
msgbox James Coughlan Excel Discussion (Misc queries) 3 May 3rd 06 01:57 PM
msgbox flow23 Excel Discussion (Misc queries) 0 January 10th 06 03:25 PM
Help with MsgBox... tjb Excel Worksheet Functions 3 December 29th 04 03:43 PM


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