measuring load time

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

Guest

Hi,

Would it be possible to time how long it takes for Excel to open a workbook
and dump the result (amount of seconds) in a cell? I can't find anything
about this on the net, but I'd like to know if it's possible at all?
 
Hi,

Would it be possible to time how long it takes for Excel to open a workbook
and dump the result (amount of seconds) in a cell? I can't find anything
about this on the net, but I'd like to know if it's possible at all?

I modified what I found at this site :http://www.vbaexpress.com/kb/
getarticle.php?kb_id=405
to measure load time of a workbook. The following code will work if
you're measuring how long a particular workbook opens.

There is a way to modify this code to check ans see how long Add-
in'stake to load, but it would be kinda clunky as far as I envision
it. If that's what you're trying to do let me know and I can share my
thoughts, but try this to see load time of a particular file:

'Add this code to the Workbook_Open Routine

Dim oFSO As Object, Folder As Object, File As Object

Set oFSO = CreateObject("Scripting.FileSystemObject")
Set Folder = oFSO.GetFolder(ThisWorkbook.Path & "\")

For Each File In Folder.Files
If UCase(File.Name) = UCase(ThisWorkbook.Name) Then
MsgBox Format(Now - File.DateLastAccessed, "hh:mm:ss")
End If
Next File


Set oFSO = Nothing
Set Folder = Nothing
 
Don, works perfect (although I don't fully get the code). I don't need it
more detailed than this.

Thanks!
Hendrik
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top