Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Starting a Macro when Command is Executed?


Is there anyway for me to have a macro run automatically whenever an
action is done on Excel? For example, could I set up a macro that saves
the file to automatically run whenever I print?


--
Losse
------------------------------------------------------------------------
Losse's Profile: http://www.excelforum.com/member.php...o&userid=24813
View this thread: http://www.excelforum.com/showthread...hreadid=386133

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Starting a Macro when Command is Executed?

You can trap events and fire your macro from there. For instance, there is a
BeforePrint event. See http://www.cpearson.com/excel/events.htm, it says
Excel97 but it is still valid.

--
HTH

Bob Phillips

"Losse" wrote in
message ...

Is there anyway for me to have a macro run automatically whenever an
action is done on Excel? For example, could I set up a macro that saves
the file to automatically run whenever I print?


--
Losse
------------------------------------------------------------------------
Losse's Profile:

http://www.excelforum.com/member.php...o&userid=24813
View this thread: http://www.excelforum.com/showthread...hreadid=386133



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Starting a Macro when Command is Executed?


How would I get it to run automatically as soon as an event occurs?
doubt this would work, but could I do something with a similar ide
to:

If Workbook_BeforePrint = true Then
Call "SaveMacro"
End I

--
Loss
-----------------------------------------------------------------------
Losse's Profile: http://www.excelforum.com/member.php...fo&userid=2481
View this thread: http://www.excelforum.com/showthread.php?threadid=38613

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Starting a Macro when Command is Executed?

No it would be something like

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Call "SaveMacro"
End Sub

Read the link I gave you.

--
HTH

Bob Phillips

"Losse" wrote in
message ...

How would I get it to run automatically as soon as an event occurs? I
doubt this would work, but could I do something with a similar idea
to:

If Workbook_BeforePrint = true Then
Call "SaveMacro"
End If


--
Losse
------------------------------------------------------------------------
Losse's Profile:

http://www.excelforum.com/member.php...o&userid=24813
View this thread: http://www.excelforum.com/showthread...hreadid=386133



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Starting a Macro when Command is Executed?

Sorry, meant

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Call SaveMacro
End Sub


--
HTH

Bob Phillips

"Bob Phillips" wrote in message
...
No it would be something like

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Call "SaveMacro"
End Sub

Read the link I gave you.

--
HTH

Bob Phillips

"Losse" wrote in
message ...

How would I get it to run automatically as soon as an event occurs? I
doubt this would work, but could I do something with a similar idea
to:

If Workbook_BeforePrint = true Then
Call "SaveMacro"
End If


--
Losse
------------------------------------------------------------------------
Losse's Profile:

http://www.excelforum.com/member.php...o&userid=24813
View this thread:

http://www.excelforum.com/showthread...hreadid=386133







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Starting a Macro when Command is Executed?


Thank you. Is there also an event that happens before a macro is run or
the macro screen is selected?


--
Losse
------------------------------------------------------------------------
Losse's Profile: http://www.excelforum.com/member.php...o&userid=24813
View this thread: http://www.excelforum.com/showthread...hreadid=386133

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Starting a Macro when Command is Executed?

Which macro, yours or the BeforePrint event?

--
HTH

Bob Phillips

"Losse" wrote in
message ...

Thank you. Is there also an event that happens before a macro is run or
the macro screen is selected?


--
Losse
------------------------------------------------------------------------
Losse's Profile:

http://www.excelforum.com/member.php...o&userid=24813
View this thread: http://www.excelforum.com/showthread...hreadid=386133



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Starting a Macro when Command is Executed?


I was referring to when the user goes to tools.macro. Is there an even
before the choices of the macros to select appears

--
Loss
-----------------------------------------------------------------------
Losse's Profile: http://www.excelforum.com/member.php...fo&userid=2481
View this thread: http://www.excelforum.com/showthread.php?threadid=38613

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Starting a Macro when Command is Executed?

No.

--
HTH

Bob Phillips

"Losse" wrote in
message ...

I was referring to when the user goes to tools.macro. Is there an event
before the choices of the macros to select appears?


--
Losse
------------------------------------------------------------------------
Losse's Profile:

http://www.excelforum.com/member.php...o&userid=24813
View this thread: http://www.excelforum.com/showthread...hreadid=386133



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
Macro get executed twice Anand Nichkaode Excel Discussion (Misc queries) 3 September 24th 08 01:25 PM
require password each time a macro is executed Marty Excel Programming 6 October 10th 04 08:13 PM
Starting with command Marcus Excel Programming 1 July 14th 04 10:34 AM
Parameter Query executed from a Macro David Excel Programming 4 April 19th 04 11:37 PM
Macro not executed Excel -- PowerPoint rick_deacha Excel Programming 0 February 24th 04 04:55 PM


All times are GMT +1. The time now is 01:13 AM.

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"