Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with VBA code under Excel 2007

Status
Not open for further replies.

pruleone

Technical User
Apr 14, 2009
74
EE
Hi,

I made excel and VBA code under Excel 2003. Everything worked ok. Now I have excel 2007 and I have problem with one VBA code or one part from it.

Code is:
Public vartimer As Variant
Const TimeOut = 200
Sub Salva1()
Call update
Call Tempo1
End Sub
Sub Tempo1()
vartimer = Format(Now + TimeSerial(0, 0, TimeOut), "hh:mm:ss")
If vartimer = "" Then Exit Sub
Application.OnTime TimeValue(vartimer), "Salva1"
End Sub
Sub Limpa1()
On Error Resume Next
Application.OnTime earliesttime:=vartimer, _
procedure:="Salva1", schedule:=False
On Error GoTo 0
End Sub

Problem is with Sub Temo1.
Running it excel will show me error - Compile error: Can't find project or libary. After pressing OK, Format is highlighted.

Can anyone give some good hint, what to do? Where to find solution.
 
No MISSING reference ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 



PHV is refereing to Tools > Refrences in the VB Editor menu.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Thank you,

one reference was too much but unfortunately I lost the name.
But what should be check are:
Visual Basic For Applications
Microsoft Excel 12.0 Object Library
OLE Automation
Microsoft Office 12.0 Object Library
Microsoft Forms 2.0 Object Library
 
Does adding "VBA." in front of the Format( help? I'm assuming no MISSING references were found??

Regards,
Zack Barresse

Simplicity is the ultimate sophistication. What is a MS MVP?
- Leonardo da Vinci
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top