View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
MC MC is offline
external usenet poster
 
Posts: 29
Default The use of VBA function "Time" in an Excel Macro

Hi Conan, thanks for your suggestion but I have both the analysis toolpak and
analysis toolpak - VBA add-ins installed and I'm still getting the same error
which also comes out with the function format() of VB.

I avoided the use of the time function substituting this

= Format(Time, "hh:mm:ss AMPM")

by this:

With .Cells(1, 5)
.Formula = "=now()"
.NumberFormat = "hh:mm:ss;@"
End With

but then I'm getting the same error with the use of format in this function
(thisone I don't know how to avoid...)

Public Function F(r As Variant, i As Integer) As Variant
r = Value(r, (DemB))
If i = 4 Then
F = Format(r, "###0.0000")
Else: F = Format(r, "###0.00")
End If
End Function

I also checked in the folder "program files\common files\Microsoft
shared\VBA\VBA6" and there are a bunch of DLLs, apparently no one has the
functions mentioned above or Excel isn't getting access to them...


"Conan Kelly" wrote:

MC,

I don't know much about the add-ins that come with XL, but looking at my
list, there are 2 with VBA in the title: Analysis ToolPak - VBA and
Internet Assistant VBA.

Just geussing, but I don't think Internet Assistant VBA would have it.

Do you have either of those 2 add-ins enabled on your computer? Does the
problematic computer have them enabled?

If they are not listed, they will probably need to be installed.

HTH,

Conan




"MC" wrote in message
...
Thanks Conan,
will check ... any suggestion as to which add-in would include such "Time"
function frm VBA???
thanks
MC

"Conan Kelly" wrote:

MC,

Check the Add-Ins in XL on your computer and make sure the troublesome
computer has the same add-ins enabled.

HTH,

Conan Kelly




"MC" wrote in message
...
Hi,
I've been using a Macro in Excel to calculate certain averages that
uses
the
function "Time" from VBA libraries. When trying to run the same Macro
in
another computer with the same version of Excel (Excel 2003
(11.5612.5606)),
I get the compile error messasge: "Can't find project or library" and
highlights the term "Time". It looks as if that function "Time" is in
a
library that this version of excel has no access to. Is there anyway
to
"solve" this?
Thanks for any suggestion,
MC