messages when I run a macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am runing a Excel Macro from Access. When I go to save
the file, it asks me if I would like to overwrite an
already existing file. I would like the macro to
overwrite without any intervension.

When I run the macro, I see the actions in fast-forward.
I do not want to confuse the user. Is there a way I can
display an hour glass and have the actions go on in the
background and inform the user once the actions are over?

Thanks
..
 
-----Original Message-----
I am runing a Excel Macro from Access. When I go to save
the file, it asks me if I would like to overwrite an
already existing file. I would like the macro to
overwrite without any intervension.

When I run the macro, I see the actions in fast-forward.
I do not want to confuse the user. Is there a way I can
display an hour glass and have the actions go on in the
background and inform the user once the actions are over?

Thanks
..
Hi,
if the screen messages are associated with Excel use:
Application.DisplayAlerts=false

In Access use:
DoCmd.Echo false

You must turn on using:
DoCmd.Echo true

In Access to display an hourglass use:
DoCmd.HourGlass true

You must turn off using:
DoCmd.HourGlass false

In Access you should use an error handler when using
DoCmd.HourGlass and/of DoCmd.Echo as if an error occurs
you may cause a problem if you don't reset the screen
and/or mouse pointer.

***** sample code start *****

Sub ExampleProc()
on error goto ErrorHandler

docmd.echo false
docmd.hourglass true

' code

ExampleProc_Exit:
on error goto 0
docmd.echo true
docmd.hourglass false
exit sub

ErrorHandler:
msgbox "Error: " & err.description
resume ExampleProc_Exit
End Sub

**** sample code end ******

Luck
Jonathan
 
thank you...I will try that.
-----Original Message-----

Hi,
if the screen messages are associated with Excel use:
Application.DisplayAlerts=false

In Access use:
DoCmd.Echo false

You must turn on using:
DoCmd.Echo true

In Access to display an hourglass use:
DoCmd.HourGlass true

You must turn off using:
DoCmd.HourGlass false

In Access you should use an error handler when using
DoCmd.HourGlass and/of DoCmd.Echo as if an error occurs
you may cause a problem if you don't reset the screen
and/or mouse pointer.

***** sample code start *****

Sub ExampleProc()
on error goto ErrorHandler

docmd.echo false
docmd.hourglass true

' code

ExampleProc_Exit:
on error goto 0
docmd.echo true
docmd.hourglass false
exit sub

ErrorHandler:
msgbox "Error: " & err.description
resume ExampleProc_Exit
End Sub

**** sample code end ******

Luck
Jonathan
.
 
Back
Top