<?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: Script not calling second VBA after _close in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/script-not-calling-second-vba-after-close/m-p/2154782#M21703</link>
    <description>Even if there's a blank drawing still open?</description>
    <pubDate>Tue, 15 Jan 2008 15:12:31 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2008-01-15T15:12:31Z</dc:date>
    <item>
      <title>Script not calling second VBA after _close</title>
      <link>https://forums.autodesk.com/t5/vba-forum/script-not-calling-second-vba-after-close/m-p/2154778#M21699</link>
      <description>Hi, chaps.&lt;BR /&gt;
&lt;BR /&gt;
I'm having problems calling VBA functions from a script:&lt;BR /&gt;
&lt;BR /&gt;
Public Sub BTissued1()&lt;BR /&gt;
MsgBox "1a"&lt;BR /&gt;
ThisDrawing.Close&lt;BR /&gt;
MsgBox "1b"&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
Public Sub BTissued2()&lt;BR /&gt;
MsgBox "2"&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
-vbarun BTissued1 &lt;BR /&gt;
-vbarun BTissued2 &lt;BR /&gt;
&lt;BR /&gt;
(There's a space at the end of each line in the script.)&lt;BR /&gt;
&lt;BR /&gt;
When I run the script I get "1a" displayed and the file closes; I then get "1b" but that's it. If I take "ThisDrawing.Close" away from BTissued1 I get all MsgBoxes.&lt;BR /&gt;
&lt;BR /&gt;
(FYI, the reason I'm using a script is because in my full routine I'll be running a LISP routine between BTissued1 and BTissued2.)&lt;BR /&gt;
&lt;BR /&gt;
I've tried the script:&lt;BR /&gt;
&lt;BR /&gt;
(alert "1")&lt;BR /&gt;
_close y&lt;BR /&gt;
(alert "2")&lt;BR /&gt;
&lt;BR /&gt;
but to no avail. Something similar worked in 2007 but has something changed in 2008?&lt;BR /&gt;
&lt;BR /&gt;
S</description>
      <pubDate>Mon, 14 Jan 2008 14:56:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/script-not-calling-second-vba-after-close/m-p/2154778#M21699</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-14T14:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: Script not calling second VBA after _close</title>
      <link>https://forums.autodesk.com/t5/vba-forum/script-not-calling-second-vba-after-close/m-p/2154779#M21700</link>
      <description>try placing a line like:&lt;BR /&gt;
On Error Resume Next&lt;BR /&gt;
&lt;BR /&gt;
as the first line of each of your subs... and do a thisdrawing.open ... before you make a msgbox call...&lt;BR /&gt;
&lt;BR /&gt;
Are both of those subs saved in the same file?</description>
      <pubDate>Mon, 14 Jan 2008 21:35:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/script-not-calling-second-vba-after-close/m-p/2154779#M21700</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-14T21:35:04Z</dc:date>
    </item>
    <item>
      <title>Re: Script not calling second VBA after _close</title>
      <link>https://forums.autodesk.com/t5/vba-forum/script-not-calling-second-vba-after-close/m-p/2154780#M21701</link>
      <description>rudderdl,&lt;BR /&gt;
&lt;BR /&gt;
No change I'm afraid.&lt;BR /&gt;
&lt;BR /&gt;
S</description>
      <pubDate>Mon, 14 Jan 2008 23:13:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/script-not-calling-second-vba-after-close/m-p/2154780#M21701</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-14T23:13:10Z</dc:date>
    </item>
    <item>
      <title>Re: Script not calling second VBA after _close</title>
      <link>https://forums.autodesk.com/t5/vba-forum/script-not-calling-second-vba-after-close/m-p/2154781#M21702</link>
      <description>A command line to receive the command from the script is required.&lt;BR /&gt;
If the first macro closes the drawing then the command to run the&lt;BR /&gt;
second macro has no place to go.</description>
      <pubDate>Tue, 15 Jan 2008 15:06:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/script-not-calling-second-vba-after-close/m-p/2154781#M21702</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-15T15:06:20Z</dc:date>
    </item>
    <item>
      <title>Re: Script not calling second VBA after _close</title>
      <link>https://forums.autodesk.com/t5/vba-forum/script-not-calling-second-vba-after-close/m-p/2154782#M21703</link>
      <description>Even if there's a blank drawing still open?</description>
      <pubDate>Tue, 15 Jan 2008 15:12:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/script-not-calling-second-vba-after-close/m-p/2154782#M21703</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-15T15:12:31Z</dc:date>
    </item>
    <item>
      <title>Re: Script not calling second VBA after _close</title>
      <link>https://forums.autodesk.com/t5/vba-forum/script-not-calling-second-vba-after-close/m-p/2154783#M21704</link>
      <description>In your script - try calling the VBA macro in the following format (this will avoid any and all reload errors...):&lt;BR /&gt;
&lt;BR /&gt;
(setq MyDVB ("c:\FullPath\DVBfile.dvb!ModuleName.SubName"))&lt;BR /&gt;
(command "vbarun" MyDVB)</description>
      <pubDate>Tue, 15 Jan 2008 15:19:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/script-not-calling-second-vba-after-close/m-p/2154783#M21704</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-15T15:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: Script not calling second VBA after _close</title>
      <link>https://forums.autodesk.com/t5/vba-forum/script-not-calling-second-vba-after-close/m-p/2154784#M21705</link>
      <description>Ok, I'll give it a bash...</description>
      <pubDate>Tue, 15 Jan 2008 15:22:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/script-not-calling-second-vba-after-close/m-p/2154784#M21705</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-15T15:22:02Z</dc:date>
    </item>
    <item>
      <title>Re: Script not calling second VBA after _close</title>
      <link>https://forums.autodesk.com/t5/vba-forum/script-not-calling-second-vba-after-close/m-p/2154785#M21706</link>
      <description>Mea culpa. It seems that the script is tied to the command line of&lt;BR /&gt;
the drawing that started it - which makes sense now that I think&lt;BR /&gt;
about it.</description>
      <pubDate>Tue, 15 Jan 2008 15:23:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/script-not-calling-second-vba-after-close/m-p/2154785#M21706</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-15T15:23:55Z</dc:date>
    </item>
    <item>
      <title>Re: Script not calling second VBA after _close</title>
      <link>https://forums.autodesk.com/t5/vba-forum/script-not-calling-second-vba-after-close/m-p/2154786#M21707</link>
      <description>That was going to be my next line of attack (honest). It seemed that whenever a close (VBA or Script) occurred the script stopped.&lt;BR /&gt;
&lt;BR /&gt;
Fingers crossed...</description>
      <pubDate>Tue, 15 Jan 2008 15:26:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/script-not-calling-second-vba-after-close/m-p/2154786#M21707</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-15T15:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: Script not calling second VBA after _close</title>
      <link>https://forums.autodesk.com/t5/vba-forum/script-not-calling-second-vba-after-close/m-p/2154787#M21708</link>
      <description>Fingers broken!&lt;BR /&gt;
&lt;BR /&gt;
I've simplified this and taken out any reference to VBA for the time bean. Just plain ole script.&lt;BR /&gt;
&lt;BR /&gt;
_open*"G:\5-2.dwg"&lt;BR /&gt;
_line*90,500*940,540*&lt;BR /&gt;
_qsave&lt;BR /&gt;
_close&lt;BR /&gt;
_line*90,500*940,540*&lt;BR /&gt;
&lt;BR /&gt;
(The *s represent spaces in the actual script.)&lt;BR /&gt;
&lt;BR /&gt;
I have a drawing open, 5-1.dwg. I run the script: it opens 5-2.dwg, draws a line, saves, closes, but doesn't draw the line in the original file, 5-1. (I've tried a space after _close but that just calls _script again.)&lt;BR /&gt;
&lt;BR /&gt;
When my VBAs didn't work I was 'happy'. Now that a simple script doesn't work I'm upset. Am I a div? Help, please.&lt;BR /&gt;
&lt;BR /&gt;
S</description>
      <pubDate>Tue, 15 Jan 2008 16:18:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/script-not-calling-second-vba-after-close/m-p/2154787#M21708</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-15T16:18:13Z</dc:date>
    </item>
    <item>
      <title>Re: Script not calling second VBA after _close</title>
      <link>https://forums.autodesk.com/t5/vba-forum/script-not-calling-second-vba-after-close/m-p/2154788#M21709</link>
      <description>When you are closing your file... is there another drawing still open behind it?</description>
      <pubDate>Tue, 15 Jan 2008 16:38:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/script-not-calling-second-vba-after-close/m-p/2154788#M21709</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-15T16:38:08Z</dc:date>
    </item>
    <item>
      <title>Re: Script not calling second VBA after _close</title>
      <link>https://forums.autodesk.com/t5/vba-forum/script-not-calling-second-vba-after-close/m-p/2154789#M21710</link>
      <description>Yep, 5-1.dwg. It's this one that I want to draw the second line in.</description>
      <pubDate>Tue, 15 Jan 2008 16:52:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/script-not-calling-second-vba-after-close/m-p/2154789#M21710</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-15T16:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: Script not calling second VBA after _close</title>
      <link>https://forums.autodesk.com/t5/vba-forum/script-not-calling-second-vba-after-close/m-p/2154790#M21711</link>
      <description>Post your whole script file along with the dwg's in a zip file...</description>
      <pubDate>Tue, 15 Jan 2008 16:54:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/script-not-calling-second-vba-after-close/m-p/2154790#M21711</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-15T16:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: Script not calling second VBA after _close</title>
      <link>https://forums.autodesk.com/t5/vba-forum/script-not-calling-second-vba-after-close/m-p/2154791#M21712</link>
      <description>Ok-dokey.</description>
      <pubDate>Tue, 15 Jan 2008 16:56:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/script-not-calling-second-vba-after-close/m-p/2154791#M21712</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-15T16:56:51Z</dc:date>
    </item>
    <item>
      <title>Re: Script not calling second VBA after _close</title>
      <link>https://forums.autodesk.com/t5/vba-forum/script-not-calling-second-vba-after-close/m-p/2154792#M21713</link>
      <description>;;; Try this...&lt;BR /&gt;
_open&lt;BR /&gt;
"G:\5-1.dwg"&lt;BR /&gt;
_line 90,500 940,540&lt;BR /&gt;
&lt;BR /&gt;
_qsave&lt;BR /&gt;
_close&lt;BR /&gt;
_open&lt;BR /&gt;
"G:\5-2.dwg"&lt;BR /&gt;
_line 90,500 940,540&lt;BR /&gt;
&lt;BR /&gt;
_qsave&lt;BR /&gt;
_close&lt;BR /&gt;
&lt;BR /&gt;
;;Worked for me...</description>
      <pubDate>Tue, 15 Jan 2008 18:18:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/script-not-calling-second-vba-after-close/m-p/2154792#M21713</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-15T18:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: Script not calling second VBA after _close</title>
      <link>https://forums.autodesk.com/t5/vba-forum/script-not-calling-second-vba-after-close/m-p/2154793#M21714</link>
      <description>Ok, thanks for that. Slightly modified,&lt;BR /&gt;
&lt;BR /&gt;
_open "G:\5-1.dwg"&lt;BR /&gt;
_line 90,500 940,540 &lt;BR /&gt;
_qsave&lt;BR /&gt;
_close&lt;BR /&gt;
_open "G:\5-2.dwg"&lt;BR /&gt;
_line 90,500 940,540 &lt;BR /&gt;
_qsave&lt;BR /&gt;
_close&lt;BR /&gt;
&lt;BR /&gt;
works ok. But what if the second drawing is already open? The first _close this time seems to terminates the script and the line isn't drawn nor the drawing closed...?&lt;BR /&gt;
&lt;BR /&gt;
_open "G:\5-1.dwg"&lt;BR /&gt;
_line 90,500 940,540 &lt;BR /&gt;
_qsave&lt;BR /&gt;
_close&lt;BR /&gt;
_line 90,500 940,540 &lt;BR /&gt;
_close</description>
      <pubDate>Tue, 15 Jan 2008 18:50:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/script-not-calling-second-vba-after-close/m-p/2154793#M21714</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-15T18:50:48Z</dc:date>
    </item>
    <item>
      <title>Re: Script not calling second VBA after _close</title>
      <link>https://forums.autodesk.com/t5/vba-forum/script-not-calling-second-vba-after-close/m-p/2154794#M21715</link>
      <description>use lsp n the script to verify if the drawing is open...&lt;BR /&gt;
Scripts are static otherwise (make sure the dwg is closed)</description>
      <pubDate>Tue, 15 Jan 2008 18:53:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/script-not-calling-second-vba-after-close/m-p/2154794#M21715</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-15T18:53:35Z</dc:date>
    </item>
  </channel>
</rss>

