I’m using VB 6.0 and it gives me:
Compile Error:
Can’t Find Project or Library
in this sub:
Private Sub MDITimer_Timer()
Dim textStr As String
textStr = Format(Now, "dd-mm-yyyy hh:mm:ss")
StatusBar.Panels(1).Text = textStr
End Sub
I made it like this and the error still was in the Format function (so it is not a StatusBar problem).
Can you tell me what is the Reference that we have to add to use the Format function? Or if a Reference is not needed, what do we have to do to make this work?
You probably overloaded
Format()with a declaration of the same name. Have you tried callingVBA.Format()instead?You should also use
Format$()to avoid the unnecessary overhead of working with the Variant resultFormat()returns.