<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/close-method/m-p/341493#M82829</link>
    <description>Howdy,&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ok, here is your problem. You need to have code like the following to open&lt;BR /&gt;
your drawing and assign your drawing to a variable.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
'Assign the AcadDocument object to a variable. This will hold the drawing&lt;BR /&gt;
that is currently being opened&lt;BR /&gt;
Dim NewDWG as AcadDocument&lt;BR /&gt;
&lt;BR /&gt;
'To open a dwg&lt;BR /&gt;
Set NewDWG=application.documents.open (&lt;DRAWING location="" and="" name="" goes=""&gt;&lt;BR /&gt;
here&amp;gt;)&lt;BR /&gt;
'set this to ensure that the newly opened drawing is active and given the&lt;BR /&gt;
focus&lt;BR /&gt;
newdwg.activate&lt;BR /&gt;
&lt;BR /&gt;
'to close the dwg without closing AutoCAD&lt;BR /&gt;
NewDWG.close&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Jorge Lopez" &lt;JORGE.LOPEZ&gt; wrote in message&lt;BR /&gt;
news:3FAEE427B568B17D74869AE6DA620469@in.WebX.maYIadrTaRb...&lt;BR /&gt;
My suggestion would be to open the DWG file outside of the AutoCAD editor&lt;BR /&gt;
using the AxDbDocument object. (You need to register AXDB15.DLL on your&lt;BR /&gt;
machine.)&lt;BR /&gt;
&lt;BR /&gt;
"wlefferd" &lt;WLEFFERD&gt; wrote in message&lt;BR /&gt;
news:f06417c.9@WebX.maYIadrTaRb...&lt;BR /&gt;
In the sub aaa there is a line&lt;BR /&gt;
xxx = Image_List_From_Xref(XrefName(0))&lt;BR /&gt;
That function has the close method in it and should return&lt;BR /&gt;
a multi dim array.&lt;BR /&gt;
the line below that&lt;BR /&gt;
If VarType(xxx) &amp;gt; 8000 Then&lt;BR /&gt;
check to see if it returned an array or not&lt;BR /&gt;
the lines below that are just reading the array if it returned one.&lt;BR /&gt;
What I am doing to see it it is working is in the VBA editor&lt;BR /&gt;
putting one of the brown dots in the margin which stops the execution of the&lt;BR /&gt;
code at that spot and lets you read the variables before it in that sub or&lt;BR /&gt;
function it was stopped in. If the line I choose to stop on is not run it&lt;BR /&gt;
does not stop. I should be able to stop on the line&lt;BR /&gt;
If VarType(xxx) &amp;gt; 8000 Then&lt;BR /&gt;
because should run the If statement wether or not an array was returned. But&lt;BR /&gt;
the program goes right past the statement and terminates which makes me&lt;BR /&gt;
thing it has terminated before that. If I comment out the close statement it&lt;BR /&gt;
works fine except for not closeing the drawing.&lt;BR /&gt;
Wayne&lt;/WLEFFERD&gt;&lt;/JORGE.LOPEZ&gt;&lt;/DRAWING&gt;</description>
    <pubDate>Mon, 06 Aug 2001 17:34:10 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2001-08-06T17:34:10Z</dc:date>
    <item>
      <title>Close Method</title>
      <link>https://forums.autodesk.com/t5/vba-forum/close-method/m-p/341480#M82816</link>
      <description>The close medhod stops the execution of my VBA program.&lt;BR /&gt;
&lt;BR /&gt;
I am in a drawing and run a VBA program. The program opens up an existing drawing extracts out some block information, closes the drawing then attempts to use the information in the current drawing.  Yesterday it would not work then it started working for some unknow reason. Now today it doesn't work.  The code works fine if I comment out the close command.&lt;BR /&gt;
&lt;BR /&gt;
What am I doing wrong.&lt;BR /&gt;
&lt;BR /&gt;
Wayne Lefferd</description>
      <pubDate>Mon, 09 Jul 2001 07:47:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/close-method/m-p/341480#M82816</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-07-09T07:47:33Z</dc:date>
    </item>
    <item>
      <title>Re: Close Method</title>
      <link>https://forums.autodesk.com/t5/vba-forum/close-method/m-p/341481#M82817</link>
      <description>&lt;DIV&gt;&lt;FONT size="2"&gt;Wayne:&lt;BR /&gt;&lt;BR /&gt;What version of AutoCAD are you using?&amp;nbsp; &lt;BR /&gt;
What is the value of your SDI variable?&amp;nbsp; (This&amp;nbsp;determines if you can &lt;BR /&gt;
have multiple drawings open.) If you could post your code it might help diagnose &lt;BR /&gt;
the problem.&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;Thanks,&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;Andy Roe&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="3"&gt;wlefferd &amp;lt;&lt;/FONT&gt;&lt;A&gt;&lt;BR /&gt;
href="mailto:wlefferd@cvtv.net"&amp;gt;wlefferd@cvtv.net&lt;/A&gt;&amp;gt; wrote in message &lt;A&gt;&lt;BR /&gt;
href="news:f06417c.-1@WebX.maYIadrTaRb"&amp;gt;news:f06417c.-1@WebX.maYIadrTaRb&lt;/A&gt;...&lt;/DIV&gt;&lt;BR /&gt;
&lt;BLOCKQUOTE dir="ltr"&gt;&lt;BR /&gt;
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"&amp;gt;The &lt;BR /&gt;
  close medhod stops the execution of my VBA program. &lt;BR /&gt;
  &lt;P&gt;I am in a drawing and run a VBA program. The program opens up an existing &lt;BR /&gt;
  drawing extracts out some block information, closes the drawing then attempts &lt;BR /&gt;
  to use the information in the current drawing. Yesterday it would not work &lt;BR /&gt;
  then it started working for some unknow reason. Now today it doesn't work. The &lt;BR /&gt;
  code works fine if I comment out the close command. &lt;BR /&gt;
  &lt;/P&gt;&lt;P&gt;What am I doing wrong. &lt;BR /&gt;
  &lt;/P&gt;&lt;P&gt;Wayne Lefferd&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Mon, 09 Jul 2001 13:29:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/close-method/m-p/341481#M82817</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-07-09T13:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: Close Method</title>
      <link>https://forums.autodesk.com/t5/vba-forum/close-method/m-p/341482#M82818</link>
      <description>&lt;DIV&gt;&lt;FONT size="2"&gt;If you have no document open after you execute the Close &lt;BR /&gt;
method&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;then that is your problem.&amp;nbsp;You will not be able &lt;BR /&gt;
to&amp;nbsp;interact with AutoCAD&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;without a Document object.&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;Joe&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BLOCKQUOTE dir="ltr"&gt;&lt;BR /&gt;
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
  &lt;DIV&gt;"wlefferd" &amp;lt;&lt;A&gt;&lt;BR /&gt;
  href="mailto:wlefferd@cvtv.net"&amp;gt;wlefferd@cvtv.net&lt;/A&gt;&amp;gt; wrote in message &lt;A&gt;&lt;BR /&gt;
  href="news:f06417c.-1@WebX.maYIadrTaRb"&amp;gt;news:f06417c.-1@WebX.maYIadrTaRb&lt;/A&gt;...&lt;/DIV&gt;The &lt;BR /&gt;
  close medhod stops the execution of my VBA program. &lt;BR /&gt;
  &lt;P&gt;I am in a drawing and run a VBA program. The program opens up an existing &lt;BR /&gt;
  drawing extracts out some block information, closes the drawing then attempts &lt;BR /&gt;
  to use the information in the current drawing. Yesterday it would not work &lt;BR /&gt;
  then it started working for some unknow reason. Now today it doesn't work. The &lt;BR /&gt;
  code works fine if I comment out the close command. &lt;BR /&gt;
  &lt;/P&gt;&lt;P&gt;What am I doing wrong. &lt;BR /&gt;
  &lt;/P&gt;&lt;P&gt;Wayne Lefferd&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 10 Jul 2001 06:37:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/close-method/m-p/341482#M82818</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-07-10T06:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: Close Method</title>
      <link>https://forums.autodesk.com/t5/vba-forum/close-method/m-p/341483#M82819</link>
      <description>This is a copy of most of the code.  I have added as many comments as I can so someone might beable to follow it. there are 2 or 3 functions that are called that are in dll's and are not here.&lt;BR /&gt;
&lt;BR /&gt;
Wayne Lefferd&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Sub aaa()&lt;BR /&gt;
Dim xxx As Variant&lt;BR /&gt;
Dim Cnt As Integer&lt;BR /&gt;
Dim XrefName As Variant&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
XrefName = wl.Get_XrefName        'returns an array of xref names in the drawing this function is in a dll and not here&lt;BR /&gt;
xxx = Image_List_From_Xref(XrefName(0))          'returns an array of the block names in the drawing that is xref in the drawing&lt;BR /&gt;
                                   ' the program is not continuming beyond this point&lt;BR /&gt;
If VarType(xxx) &amp;gt; 8000 Then          'check to see if the above function retruned an array or not&lt;BR /&gt;
xxx(21, 0) = xxx(21, 0)                  ' the rest of this is just checking to see what was returned&lt;BR /&gt;
xxx(21, 1) = xxx(21, 1)&lt;BR /&gt;
xxx(21, 2)(0) = xxx(21, 2)(0)&lt;BR /&gt;
xxx(21, 3) = xxx(21, 3)&lt;BR /&gt;
xxx(1, 0) = xxx(1, 0)&lt;BR /&gt;
Cnt = UBound(xxx)&lt;BR /&gt;
Cnt = Cnt&lt;BR /&gt;
End If&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Function Image_List_From_Xref(ByVal XrefName As String)&lt;BR /&gt;
Dim ent As AcadEntity&lt;BR /&gt;
Dim SSet1 As AcadSelectionSet&lt;BR /&gt;
Dim TempSortedList As Variant&lt;BR /&gt;
Dim TempArray() As Variant&lt;BR /&gt;
Dim Cnt As Integer&lt;BR /&gt;
Dim Image_Name As String&lt;BR /&gt;
Dim TempUnSortedList As Variant&lt;BR /&gt;
&lt;BR /&gt;
ThisDrawing.Application.Documents.Open XrefName + ".dwg", True  ' opens the xref drawing in read only mode&lt;BR /&gt;
&lt;BR /&gt;
TempUnSortedList = ImageBlock_List 'returns a list of the blocks in an unsorted older&lt;BR /&gt;
&lt;BR /&gt;
If VarType(TempUnSortedList) &amp;gt; 8000 Then  ' if there are no image blocks the function will return 0&lt;BR /&gt;
        TempSortedList = wl.ArraySorter(TempUnSortedList)  'sorts the array of block names.  this function is in a dll and not here&lt;BR /&gt;
        ReDim TempArray(UBound(TempSortedList), 3) '  sets up a two dim array the length of the block list&lt;BR /&gt;
&lt;BR /&gt;
        For Cnt = 0 To UBound(TempSortedList)  'goes theough the sorted block name list looking for additional info about the blocks&lt;BR /&gt;
            Image_Name = TempSortedList(Cnt)  'gets an single block name to get info on&lt;BR /&gt;
            Set SSet1 = wl.Make_Selection_Set_All(0, "INSERT", 2, Image_Name) ' sets up a selection set for all inserted items with a certain named block&lt;BR /&gt;
            If SSet1.Count &amp;gt; 0 Then 'makes sure it found at least one block with the correct name&lt;BR /&gt;
                For Each ent In SSet1    'pulling off data from block&lt;BR /&gt;
                    TempArray(Cnt, 0) = ent.Name&lt;BR /&gt;
                    TempArray(Cnt, 1) = ent.Name&lt;BR /&gt;
                    TempArray(Cnt, 2) = ent.insertionPoint&lt;BR /&gt;
                    TempArray(Cnt, 3) = ent.XScaleFactor&lt;BR /&gt;
                Next ent&lt;BR /&gt;
            End If&lt;BR /&gt;
        Next Cnt&lt;BR /&gt;
        Image_List_From_Xref = TempArray  'sets up to return array if it has any information&lt;BR /&gt;
    Else&lt;BR /&gt;
        Image_List_From_Xref = 0  ' set up to return 0 if it found nothing&lt;BR /&gt;
End If&lt;BR /&gt;
ThisDrawing.Close , False  'closes the drawing and does not save,  must have false because drawing opened in read only mode&lt;BR /&gt;
                                    ' it works fine (except for closing the drawing) if I comment out this line&lt;BR /&gt;
End Function&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Function ImageBlock_List()&lt;BR /&gt;
Dim Block_Names() As String&lt;BR /&gt;
Dim ent As AcadEntity&lt;BR /&gt;
Dim SSet1 As AcadSelectionSet&lt;BR /&gt;
Dim Cnt As Integer&lt;BR /&gt;
Set SSet1 = wl.Make_Selection_Set_All(0, "INSERT", 2, "Image_*") ' returns a selection set for all inserts in drawing with names starting with "Image_*"&lt;BR /&gt;
&lt;BR /&gt;
If SSet1.Count &amp;gt; 0 Then  ' stops if it found no matches&lt;BR /&gt;
    ReDim Block_Names(SSet1.Count - 1)&lt;BR /&gt;
    For Each ent In SSet1    ' getting name off blocks&lt;BR /&gt;
              Block_Names(Cnt) = ent.Name  ' puts names in array&lt;BR /&gt;
              Cnt = Cnt + 1&lt;BR /&gt;
    Next ent&lt;BR /&gt;
End If&lt;BR /&gt;
&lt;BR /&gt;
ImageBlock_List = wl.ArraySorter(Block_Names)  'returns sorted array of block names.  function not here its in dll&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
End Function</description>
      <pubDate>Tue, 10 Jul 2001 06:45:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/close-method/m-p/341483#M82819</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-07-10T06:45:10Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/close-method/m-p/341484#M82820</link>
      <description>The document that I had originally opened is never closed. When the program stops that drawing is on the screen.&lt;BR /&gt;
&lt;BR /&gt;
Wayne</description>
      <pubDate>Tue, 10 Jul 2001 06:48:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/close-method/m-p/341484#M82820</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-07-10T06:48:39Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/close-method/m-p/341485#M82821</link>
      <description>&lt;DIV&gt;&lt;FONT size="2"&gt;What exactly are you getting for feedback from &lt;BR /&gt;
AutoCAD?&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;Joe&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BLOCKQUOTE dir="ltr"&gt;&lt;BR /&gt;
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
  &lt;DIV&gt;"wlefferd" &amp;lt;&lt;A&gt;&lt;BR /&gt;
  href="mailto:wlefferd@cvtv.net"&amp;gt;wlefferd@cvtv.net&lt;/A&gt;&amp;gt; wrote in message &lt;A&gt;&lt;BR /&gt;
  href="news:f06417c.2@WebX.maYIadrTaRb"&amp;gt;news:f06417c.2@WebX.maYIadrTaRb&lt;/A&gt;...&lt;/DIV&gt;This &lt;BR /&gt;
  is a copy of most of the code. I have added as many comments as I can so &lt;BR /&gt;
  someone might beable to follow it. there are 2 or 3 functions that are called &lt;BR /&gt;
  that are in dll's and are not here. &lt;BR /&gt;
  &lt;P&gt;Wayne Lefferd &lt;BR /&gt;
  &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;
  &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;
  &lt;/P&gt;&lt;P&gt;Sub aaa() &lt;BR /&gt;Dim xxx As Variant &lt;BR /&gt;Dim Cnt As Integer &lt;BR /&gt;Dim XrefName As &lt;BR /&gt;
  Variant &lt;BR /&gt;
  &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;
  &lt;/P&gt;&lt;P&gt;XrefName = wl.Get_XrefName 'returns an array of xref names in the drawing &lt;BR /&gt;
  this function is in a dll and not here &lt;BR /&gt;xxx = &lt;BR /&gt;
  Image_List_From_Xref(XrefName(0)) 'returns an array of the block names in the &lt;BR /&gt;
  drawing that is xref in the drawing &lt;BR /&gt;
  &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;' &lt;BR /&gt;
  the program is not continuming beyond this point &lt;BR /&gt;If VarType(xxx) &amp;gt; 8000 &lt;BR /&gt;
  Then 'check to see if the above function retruned an array or not &lt;BR /&gt;xxx(21, &lt;BR /&gt;
  0) = xxx(21, 0) ' the rest of this is just checking to see what was returned &lt;BR /&gt;
  &lt;BR /&gt;xxx(21, 1) = xxx(21, 1) &lt;BR /&gt;xxx(21, 2)(0) = xxx(21, 2)(0) &lt;BR /&gt;xxx(21, 3) = &lt;BR /&gt;
  xxx(21, 3) &lt;BR /&gt;xxx(1, 0) = xxx(1, 0) &lt;BR /&gt;Cnt = UBound(xxx) &lt;BR /&gt;Cnt = Cnt &lt;BR /&gt;
  &lt;BR /&gt;End If &lt;BR /&gt;End Sub &lt;BR /&gt;
  &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;
  &lt;/P&gt;&lt;P&gt;Function Image_List_From_Xref(ByVal XrefName As String) &lt;BR /&gt;Dim ent As &lt;BR /&gt;
  AcadEntity &lt;BR /&gt;Dim SSet1 As AcadSelectionSet &lt;BR /&gt;Dim TempSortedList As Variant &lt;BR /&gt;
  &lt;BR /&gt;Dim TempArray() As Variant &lt;BR /&gt;Dim Cnt As Integer &lt;BR /&gt;Dim Image_Name As &lt;BR /&gt;
  String &lt;BR /&gt;Dim TempUnSortedList As Variant &lt;BR /&gt;
  &lt;/P&gt;&lt;P&gt;ThisDrawing.Application.Documents.Open XrefName + ".dwg", True ' opens the &lt;BR /&gt;
  xref drawing in read only mode &lt;BR /&gt;
  &lt;/P&gt;&lt;P&gt;TempUnSortedList = ImageBlock_List 'returns a list of the blocks in an &lt;BR /&gt;
  unsorted older &lt;BR /&gt;
  &lt;/P&gt;&lt;P&gt;If VarType(TempUnSortedList) &amp;gt; 8000 Then ' if there are no image blocks &lt;BR /&gt;
  the function will return 0 &lt;BR /&gt;
  &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;TempSortedList = &lt;BR /&gt;
  wl.ArraySorter(TempUnSortedList) 'sorts the array of block names. this &lt;BR /&gt;
  function is in a dll and not here &lt;BR /&gt;
  &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ReDim &lt;BR /&gt;
  TempArray(UBound(TempSortedList), 3) ' sets up a two dim array the length of &lt;BR /&gt;
  the block list &lt;BR /&gt;
  &lt;/P&gt;&lt;P&gt;For Cnt = 0 To UBound(TempSortedList) 'goes theough the sorted block name &lt;BR /&gt;
  list looking for additional info about the blocks &lt;BR /&gt;
  &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Image_Name &lt;BR /&gt;
  = TempSortedList(Cnt) 'gets an single block name to get info on &lt;BR /&gt;
  &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Set &lt;BR /&gt;
  SSet1 = wl.Make_Selection_Set_All(0, "INSERT", 2, Image_Name) ' sets up a &lt;BR /&gt;
  selection set for all inserted items with a certain named block &lt;BR /&gt;
  &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;If &lt;BR /&gt;
  SSet1.Count &amp;gt; 0 Then 'makes sure it found at least one block with the &lt;BR /&gt;
  correct name &lt;BR /&gt;
  &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;For &lt;BR /&gt;
  Each ent In SSet1 'pulling off data from block &lt;BR /&gt;
  &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;TempArray(Cnt, &lt;BR /&gt;
  0) = ent.Name &lt;BR /&gt;
  &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;TempArray(Cnt, &lt;BR /&gt;
  1) = ent.Name &lt;BR /&gt;
  &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;TempArray(Cnt, &lt;BR /&gt;
  2) = ent.insertionPoint &lt;BR /&gt;
  &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;TempArray(Cnt, &lt;BR /&gt;
  3) = ent.XScaleFactor &lt;BR /&gt;
  &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Next &lt;BR /&gt;
  ent &lt;BR /&gt;
  &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;End &lt;BR /&gt;
  If &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Next Cnt &lt;BR /&gt;
  &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Image_List_From_Xref = &lt;BR /&gt;
  TempArray 'sets up to return array if it has any information &lt;BR /&gt;
  &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Else &lt;BR /&gt;
  &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Image_List_From_Xref = 0 ' &lt;BR /&gt;
  set up to return 0 if it found nothing &lt;BR /&gt;End If &lt;BR /&gt;ThisDrawing.Close , &lt;BR /&gt;
  False 'closes the drawing and does not save, must have false because drawing &lt;BR /&gt;
  opened in read only mode &lt;BR /&gt;
  &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;' &lt;BR /&gt;
  it works fine (except for closing the drawing) if I comment out this line &lt;BR /&gt;
  &lt;BR /&gt;End Function &lt;BR /&gt;
  &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;
  &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;
  &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;
  &lt;/P&gt;&lt;P&gt;Function ImageBlock_List() &lt;BR /&gt;Dim Block_Names() As String &lt;BR /&gt;Dim ent As &lt;BR /&gt;
  AcadEntity &lt;BR /&gt;Dim SSet1 As AcadSelectionSet &lt;BR /&gt;Dim Cnt As Integer &lt;BR /&gt;Set &lt;BR /&gt;
  SSet1 = wl.Make_Selection_Set_All(0, "INSERT", 2, "Image_*") ' returns a &lt;BR /&gt;
  selection set for all inserts in drawing with names starting with "Image_*" &lt;BR /&gt;
  &lt;/P&gt;&lt;P&gt;If SSet1.Count &amp;gt; 0 Then ' stops if it found no matches &lt;BR /&gt;
  &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ReDim Block_Names(SSet1.Count - 1) &lt;BR /&gt;
  &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;For Each ent In SSet1 ' getting name off blocks &lt;BR /&gt;
  &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Block_Names(Cnt) &lt;BR /&gt;
  = ent.Name ' puts names in array &lt;BR /&gt;
  &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Cnt &lt;BR /&gt;
  = Cnt + 1 &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Next ent &lt;BR /&gt;End If &lt;BR /&gt;
  &lt;/P&gt;&lt;P&gt;ImageBlock_List = wl.ArraySorter(Block_Names) 'returns sorted array of &lt;BR /&gt;
  block names. function not here its in dll &lt;BR /&gt;
  &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;
  &lt;/P&gt;&lt;P&gt;End Function&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 10 Jul 2001 06:54:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/close-method/m-p/341485#M82821</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-07-10T06:54:04Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/close-method/m-p/341486#M82822</link>
      <description>My SDI is set to have multiple drawings open and I am useing autocad 2000. Would you happen to know if any of the VBA functions such as Purge or Explode have been fixed in 2002 or does all the functions work the same.&lt;BR /&gt;
I put my code in another reply.  I commented it as much as I could because the best of code is hard to follow and mine is not the best code.&lt;BR /&gt;
&lt;BR /&gt;
Wayne</description>
      <pubDate>Tue, 10 Jul 2001 06:57:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/close-method/m-p/341486#M82822</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-07-10T06:57:47Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/close-method/m-p/341487#M82823</link>
      <description>It just stops no errors on comments on nothing. The program does not hang it just quits.</description>
      <pubDate>Tue, 10 Jul 2001 07:00:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/close-method/m-p/341487#M82823</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-07-10T07:00:01Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/close-method/m-p/341488#M82824</link>
      <description>I guess I should of said AutoCad is still running my VBA program just stops.</description>
      <pubDate>Tue, 10 Jul 2001 07:04:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/close-method/m-p/341488#M82824</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-07-10T07:04:37Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/close-method/m-p/341489#M82825</link>
      <description>&lt;DIV&gt;&lt;FONT size="2"&gt;What are you expecting it to do after the .Close &lt;BR /&gt;
method?&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;Where is the code for that?&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;Joe&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;BR /&gt;
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
  &lt;DIV&gt;"wlefferd" &amp;lt;&lt;A&gt;&lt;BR /&gt;
  href="mailto:wlefferd@cvtv.net"&amp;gt;wlefferd@cvtv.net&lt;/A&gt;&amp;gt; wrote in message &lt;A&gt;&lt;BR /&gt;
  href="news:f06417c.7@WebX.maYIadrTaRb"&amp;gt;news:f06417c.7@WebX.maYIadrTaRb&lt;/A&gt;...&lt;/DIV&gt;I &lt;BR /&gt;
  guess I should of said AutoCad is still running my VBA program just &lt;BR /&gt;
stops.&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 10 Jul 2001 07:13:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/close-method/m-p/341489#M82825</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-07-10T07:13:31Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/close-method/m-p/341490#M82826</link>
      <description>In the sub aaa there is a line&lt;BR /&gt;
xxx = Image_List_From_Xref(XrefName(0))  &lt;BR /&gt;
That function has the close method in it and should return&lt;BR /&gt;
a multi dim array.&lt;BR /&gt;
&lt;BR /&gt;
 the line below that&lt;BR /&gt;
If VarType(xxx) &amp;gt; 8000 Then&lt;BR /&gt;
check to see if it returned an array or not&lt;BR /&gt;
the lines below that are just reading the array if it returned one.&lt;BR /&gt;
&lt;BR /&gt;
What I am doing to see it it is working is in the VBA editor&lt;BR /&gt;
putting one of the brown dots in the margin which stops the execution of the code at that spot and lets you read the variables before it in that sub or function it was stopped in. If the line I choose to stop on is not run it does not stop. I should be able to stop on the line &lt;BR /&gt;
If VarType(xxx) &amp;gt; 8000 Then&lt;BR /&gt;
because should run the If statement wether or not an array was returned. But the program goes right past the statement and terminates which makes me thing it has terminated before that.  If I comment out the close statement it works fine except for not closeing the drawing. &lt;BR /&gt;
&lt;BR /&gt;
Wayne</description>
      <pubDate>Tue, 10 Jul 2001 07:56:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/close-method/m-p/341490#M82826</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-07-10T07:56:04Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/close-method/m-p/341491#M82827</link>
      <description>&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;My suggestion would be to open the DWG file outside &lt;BR /&gt;
of the AutoCAD editor using the AxDbDocument object. (You need to register &lt;BR /&gt;
AXDB15.DLL on your machine.)&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BLOCKQUOTE dir="ltr"&gt;&lt;BR /&gt;
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
  &lt;DIV&gt;"wlefferd" &amp;lt;&lt;A&gt;&lt;BR /&gt;
  href="mailto:wlefferd@cvtv.net"&amp;gt;wlefferd@cvtv.net&lt;/A&gt;&amp;gt; wrote in message &lt;A&gt;&lt;BR /&gt;
  href="news:f06417c.9@WebX.maYIadrTaRb"&amp;gt;news:f06417c.9@WebX.maYIadrTaRb&lt;/A&gt;...&lt;/DIV&gt;In &lt;BR /&gt;
  the sub aaa there is a line &lt;BR /&gt;xxx = Image_List_From_Xref(XrefName(0)) &lt;BR /&gt;
  &lt;BR /&gt;That function has the close method in it and should return &lt;BR /&gt;a multi dim &lt;BR /&gt;
  array. &lt;BR /&gt;
  &lt;P&gt;the line below that &lt;BR /&gt;If VarType(xxx) &amp;gt; 8000 Then &lt;BR /&gt;check to see if &lt;BR /&gt;
  it returned an array or not &lt;BR /&gt;the lines below that are just reading the &lt;BR /&gt;
  array if it returned one. &lt;BR /&gt;
  &lt;/P&gt;&lt;P&gt;What I am doing to see it it is working is in the VBA editor &lt;BR /&gt;putting &lt;BR /&gt;
  one of the brown dots in the margin which stops the execution of the code at &lt;BR /&gt;
  that spot and lets you read the variables before it in that sub or function it &lt;BR /&gt;
  was stopped in. If the line I choose to stop on is not run it does not stop. I &lt;BR /&gt;
  should be able to stop on the line &lt;BR /&gt;If VarType(xxx) &amp;gt; 8000 Then &lt;BR /&gt;
  &lt;BR /&gt;because should run the If statement wether or not an array was returned. &lt;BR /&gt;
  But the program goes right past the statement and terminates which makes me &lt;BR /&gt;
  thing it has terminated before that. If I comment out the close statement it &lt;BR /&gt;
  works fine except for not closeing the drawing. &lt;BR /&gt;
  &lt;/P&gt;&lt;P&gt;Wayne&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 10 Jul 2001 12:14:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/close-method/m-p/341491#M82827</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-07-10T12:14:53Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/close-method/m-p/341492#M82828</link>
      <description>&lt;DIV&gt;&lt;FONT size="2"&gt;Wayne:&lt;BR /&gt;&lt;BR /&gt;I took a look at your code, but it's difficult &lt;BR /&gt;
to diagnose what's going on if you have additional DLLs that aren't included in &lt;BR /&gt;
your posting.&amp;nbsp; If you'd rather not post that code, you can email the DLLs &lt;BR /&gt;
and I could take a look.&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;Andy Roe&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;A&gt;&lt;BR /&gt;
href="mailto:agroe@compuserve.com"&amp;gt;agroe@compuserve.com&lt;/A&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BLOCKQUOTE dir="ltr"&gt;&lt;BR /&gt;
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
  &lt;DIV&gt;wlefferd &amp;lt;&lt;A href="mailto:wlefferd@cvtv.net"&gt;wlefferd@cvtv.net&lt;/A&gt;&amp;gt; &lt;BR /&gt;
  wrote in message &lt;A&gt;&lt;BR /&gt;
  href="news:f06417c.5@WebX.maYIadrTaRb"&amp;gt;news:f06417c.5@WebX.maYIadrTaRb&lt;/A&gt;...&lt;/DIV&gt;My &lt;BR /&gt;
  SDI is set to have multiple drawings open and I am useing autocad 2000. Would &lt;BR /&gt;
  you happen to know if any of the VBA functions such as Purge or Explode have &lt;BR /&gt;
  been fixed in 2002 or does all the functions work the same. &lt;BR /&gt;I put my code &lt;BR /&gt;
  in another reply. I commented it as much as I could because the best of code &lt;BR /&gt;
  is hard to follow and mine is not the best code. &lt;BR /&gt;
  &lt;P&gt;Wayne&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 10 Jul 2001 12:33:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/close-method/m-p/341492#M82828</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-07-10T12:33:02Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/close-method/m-p/341493#M82829</link>
      <description>Howdy,&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ok, here is your problem. You need to have code like the following to open&lt;BR /&gt;
your drawing and assign your drawing to a variable.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
'Assign the AcadDocument object to a variable. This will hold the drawing&lt;BR /&gt;
that is currently being opened&lt;BR /&gt;
Dim NewDWG as AcadDocument&lt;BR /&gt;
&lt;BR /&gt;
'To open a dwg&lt;BR /&gt;
Set NewDWG=application.documents.open (&lt;DRAWING location="" and="" name="" goes=""&gt;&lt;BR /&gt;
here&amp;gt;)&lt;BR /&gt;
'set this to ensure that the newly opened drawing is active and given the&lt;BR /&gt;
focus&lt;BR /&gt;
newdwg.activate&lt;BR /&gt;
&lt;BR /&gt;
'to close the dwg without closing AutoCAD&lt;BR /&gt;
NewDWG.close&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Jorge Lopez" &lt;JORGE.LOPEZ&gt; wrote in message&lt;BR /&gt;
news:3FAEE427B568B17D74869AE6DA620469@in.WebX.maYIadrTaRb...&lt;BR /&gt;
My suggestion would be to open the DWG file outside of the AutoCAD editor&lt;BR /&gt;
using the AxDbDocument object. (You need to register AXDB15.DLL on your&lt;BR /&gt;
machine.)&lt;BR /&gt;
&lt;BR /&gt;
"wlefferd" &lt;WLEFFERD&gt; wrote in message&lt;BR /&gt;
news:f06417c.9@WebX.maYIadrTaRb...&lt;BR /&gt;
In the sub aaa there is a line&lt;BR /&gt;
xxx = Image_List_From_Xref(XrefName(0))&lt;BR /&gt;
That function has the close method in it and should return&lt;BR /&gt;
a multi dim array.&lt;BR /&gt;
the line below that&lt;BR /&gt;
If VarType(xxx) &amp;gt; 8000 Then&lt;BR /&gt;
check to see if it returned an array or not&lt;BR /&gt;
the lines below that are just reading the array if it returned one.&lt;BR /&gt;
What I am doing to see it it is working is in the VBA editor&lt;BR /&gt;
putting one of the brown dots in the margin which stops the execution of the&lt;BR /&gt;
code at that spot and lets you read the variables before it in that sub or&lt;BR /&gt;
function it was stopped in. If the line I choose to stop on is not run it&lt;BR /&gt;
does not stop. I should be able to stop on the line&lt;BR /&gt;
If VarType(xxx) &amp;gt; 8000 Then&lt;BR /&gt;
because should run the If statement wether or not an array was returned. But&lt;BR /&gt;
the program goes right past the statement and terminates which makes me&lt;BR /&gt;
thing it has terminated before that. If I comment out the close statement it&lt;BR /&gt;
works fine except for not closeing the drawing.&lt;BR /&gt;
Wayne&lt;/WLEFFERD&gt;&lt;/JORGE.LOPEZ&gt;&lt;/DRAWING&gt;</description>
      <pubDate>Mon, 06 Aug 2001 17:34:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/close-method/m-p/341493#M82829</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-08-06T17:34:10Z</dc:date>
    </item>
  </channel>
</rss>

