ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro execution time (https://www.excelbanter.com/excel-programming/339411-macro-execution-time.html)

Henry

Macro execution time
 
Greetings
I have seen several post here that reference a time to run a macro. How do
I time the excution? I have a spreadsheet that is 3rd party supplied and the
performance of calcs slows down tremedously as more files are opened. I know
the easy answere is dont open them, however it is necessary for the other
files
to be open. In that the macro is 3rd party I am unable to access it and
post it here. I would like to be able to provide performance time to the
author.
Thanks!

Gareth[_6_]

Macro execution time
 
I normally time macros by doing the following:

Sub MySub()
Dim myTime as date

myTime = now

'Run the rest of the macro

'The macro has finished so now write to the
'debug window the time taken (note this does
'not include fractions of a second).
debug.print format(now - mytime, "nn:ss")

End Sub

Without being able to access the code you probably won't be able to
achieve this though. Depending on how your 3rd party macro runs you
could try and invoke it programmatically by opening the workbook perhaps
or using SendKeys to fire it - and waiting for calculation to finish
before printing the time taken.

Or failing that: use the stopwatch on your cell phone?!

HTH,
Gareth

Henry wrote:
Greetings
I have seen several post here that reference a time to run a macro. How do
I time the excution? I have a spreadsheet that is 3rd party supplied and the
performance of calcs slows down tremedously as more files are opened. I know
the easy answere is dont open them, however it is necessary for the other
files
to be open. In that the macro is 3rd party I am unable to access it and
post it here. I would like to be able to provide performance time to the
author.
Thanks!



All times are GMT +1. The time now is 07:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com