From: lahuwm on
Hi, I am trying to build a macro for a histogram. When the macro is complete,
I am asked "Histogram - Some data will be hidden by embedded chart(s)." I
can click OK or cancel. How can I build my OK response into the macro so
that I do not need to manually respond? Thank you for reviewing my question.
From: Bob Phillips on
Remove the MsgBox from the macro if it is unnecessary.

--

HTH

Bob

"lahuwm" <lahuwm(a)discussions.microsoft.com> wrote in message
news:ADD9273F-E393-4573-A3F5-BEEB344D21B0(a)microsoft.com...
> Hi, I am trying to build a macro for a histogram. When the macro is
> complete,
> I am asked "Histogram - Some data will be hidden by embedded chart(s)." I
> can click OK or cancel. How can I build my OK response into the macro so
> that I do not need to manually respond? Thank you for reviewing my
> question.


From: Mike H on
Hi,

AFAIK message boxes are modal so you can't do that but you can do it with a
userform. Create a userform and put a text box on it and include this line in
you code at the appropriate point. Note the declaration of Mytext as Public

Public MyText As String
Sub YourSub()
'Your Code
MyText = "An informative message"
UserForm1.Show
End Sub

Attach this code to the userform and it will display your message and close
after 10 seconds.

Private Sub UserForm_Activate()
TextBox1.Text = MyText
Application.Wait (Now + TimeValue("0:00:10"))
Unload UserForm1
End Sub



--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"lahuwm" wrote:

> Hi, I am trying to build a macro for a histogram. When the macro is complete,
> I am asked "Histogram - Some data will be hidden by embedded chart(s)." I
> can click OK or cancel. How can I build my OK response into the macro so
> that I do not need to manually respond? Thank you for reviewing my question.
From: EricG on
If that message is system generated, then you canadd the following to your
code to eliminate the message:

Application.DisplayAlerts = False ' Turns off system generated messages

....your code here...

Application.DisplayAlerts = True ' Turns system generated messages back on

HTH,

Eric

"lahuwm" wrote:

> Hi, I am trying to build a macro for a histogram. When the macro is complete,
> I am asked "Histogram - Some data will be hidden by embedded chart(s)." I
> can click OK or cancel. How can I build my OK response into the macro so
> that I do not need to manually respond? Thank you for reviewing my question.