2004 bug?
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
2004 bug?

 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA
Author Message
caduser77
Guest





Posted: Sun Jan 16, 2005 4:26 am    Post subject: 2004 bug? Reply with quote

Can anyone tell me why the following piece of code would result in an
"run time error key not found". I use 2002 at work and the rest of
this code works fine, but with 2004 at home it doesn't. What did I
miss?

Public Static Function blockin()
On Error Resume Next

Set clayer = ActiveDocument.ActiveLayer
Set layobj = ThisDrawing.Layers.Item(layername)
If Err <> 0 Then
'Debug here->' Set layobj = ThisDrawing.Layers.Add(layername)
layobj.Color = layercolor
End If
ActiveDocument.ActiveLayer = layobj

Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB