MR MAN Posted June 16, 2009 Posted June 16, 2009 what that message mean runtime error 94 invalid use of null i use that code to open dwgs files in listbox1 Private Sub CommandButton12_Click() For Each FIL In ListBox1.List ThisDrawing.Application.Documents.Open (FIL) Next FIL End Sub AND LINE WITH COLOR BLUE GIVE THIS ERROR CAN ANY ONE HELP ME Quote
bsamc2000 Posted June 17, 2009 Posted June 17, 2009 I added a couple of checks to the code. It appears to work. I hope this helps. [color=lime]' Check for an empty list[/color] [color=blue]If[/color] Me.ListBox1.ListCount <> 0 [color=blue]Then[/color] [color=blue]For Each[/color] Fil [color=blue]In[/color] Me.ListBox1.List [color=lime] ' Check for nul[/color] [color=blue]If [/color]Fil <> nul [color=blue]Then[/color] ThisDrawing.Application.Documents.Open (Fil) [color=blue]End If[/color] Next Fil [color=blue]End If[/color] Quote
MR MAN Posted June 21, 2009 Author Posted June 21, 2009 dear dsamc2000 i try what you say but it still give error at same line thanks for help Quote
MR MAN Posted June 28, 2009 Author Posted June 28, 2009 Can Any One Help Me To Solve This Error Quote
bsamc2000 Posted June 28, 2009 Posted June 28, 2009 I have tested this in AutoCAD 2008 and 2010 using VBA and it works in both. I will test it on a 2005 system on Monday. If you are using something other that VBA please let us know. Quote
MR MAN Posted July 1, 2009 Author Posted July 1, 2009 dear bsamc2000 iam using vba with autocad 2007 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.