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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Time & Date Object Type Libraries

Status
Not open for further replies.

hoja

Technical User
Dec 3, 2003
102
US
Can someone help me....I have a command button to insert the time & date into 2 dif. text boxes....but for some reason I'm getting an error..saying the Object Type Library must not have the proper object checked in... or something like that...
The message says "Can't Find Project Library"...can someone help me and walk me throught this and how to fix it, it was working fine on my other computer.I went to Display the References dialog box, but I don't know which one I have to check in order for this to work. PLease advice thank you.
 
hoja,

You'll need to figure out which references are missing. If you have a computer the program works on, compare the references between that one, and the one its not working on.

If you don't have that option, post the code and maybe we can figure it out from there.

Todd
 
here is the code to insert the time & date

Private Sub cmdDate_Click()
txtTime.Text = Time
txtDate.Text = Date
End Sub
 
If that is all the code you have, then you have not creatd a text object in autocad yet. Heres a little example.

Private Sub cmdDate()
Dim acText As AcadText
Dim insPt(0 To 2) As Double
Dim sText As String
Dim dTxtHt As Double

dTxtHt = 3.5
sText = CStr(Time)
insPt(0) = 1.5: insPt(1) = 1.5: insPt(2) = 0
Set acText = ThisDrawing.ModelSpace.AddText(sText, insPt, dTxtHt)

sText = CStr(Date)
insPt(0) = 10#: insPt(1) = 10#: insPt(2) = 0
Set acText = ThisDrawing.ModelSpace.AddText(sText, insPt, dTxtHt)
End Sub
 
hoja,

I have to agree with borgunit, it appears the code you have populates the text field of a form in VB/VBA. You should have the minimum references for this to work, as you cannot uncheck the most basic references - the code you posted should work with no problems. Is this the offending code or just a portion of your program?

Todd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top