Microsoft Office Tutorials and References
In Depth Information
DISCOVER THE TEMP FOLDER PATH
Additional Details: Different computers might run at different speeds, so it
is important to test the two processes on the same computer, preferably with
similar items running in both cases.
Also, note that the difference in Figure 130 is just over two-hundredths of
a second for 60,000 cells. The actual time difference for one cell is 3.9E-7
seconds—a time that will not matter to most end users. However, you, as the
reader of this topic, know that even such a small difference makes a difference
between winning and losing a bar bet.
Summary: You can use the Timer function to calculate how long a process
takes.
Source: http://www.mrexcel.com/forum/showthread.php?t=258950 and http://
www.mrexcel.com/pc17.shtml
Part
3
DISCOVER THE TEMP FOLDER PATH
Challenge: I want to fi nd the path to my computer’s temp folder in VBA.
Solution: To discover the path to your computer’s temp folder, use this code:
TempPath = Environ("Temp")
The Environ function provides a remarkable amount of information about a
system. However, you should be careful because the variables available on
one computer may not be available on another computer.
To discover which variables are available on your system, use this code:
Sub ListEnvironVariables()
For i = 1 To 99
Cells(i, 1).Value = Environ(i)
Next i
End Sub
When you run this code, you get a listing similar to the one shown in Figure 131.
Figure 131. A list of environment variables and their values for one particular system.
 
 
Search JabSto ::




Custom Search