<?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: Hide Autocad activity while VBA program is in progress in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/7609739#M65679</link>
    <description>&lt;P&gt;Did you implement the error handling I gave you and did you get an error number/description?&lt;/P&gt;</description>
    <pubDate>Fri, 08 Dec 2017 22:00:37 GMT</pubDate>
    <dc:creator>Ed__Jobe</dc:creator>
    <dc:date>2017-12-08T22:00:37Z</dc:date>
    <item>
      <title>Hide Autocad activity while VBA program is in progress</title>
      <link>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/302763#M65666</link>
      <description>I have created a program with some quick plotting macros for our various layouts and printers.  So far it seems to work fine.  Although, while running, it shows autocad switching to paperspace, creating the viewport before switching back to modelspace again.  Can this activity be hidden from the user?  It would make the program more professional looking if it could be hidden.</description>
      <pubDate>Fri, 21 Feb 2003 13:13:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/302763#M65666</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-02-21T13:13:27Z</dc:date>
    </item>
    <item>
      <title>Re: Hide Autocad activity while VBA program is in progress</title>
      <link>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/302764#M65667</link>
      <description>Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As Long) As Long&lt;BR /&gt;
&lt;BR /&gt;
    LockWindowUpdate (ThisDrawing.hwnd)&lt;BR /&gt;
' do stuff here &lt;BR /&gt;
    LockWindowUpdate (0)</description>
      <pubDate>Tue, 23 Aug 2005 16:18:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/302764#M65667</guid>
      <dc:creator>arcticad</dc:creator>
      <dc:date>2005-08-23T16:18:01Z</dc:date>
    </item>
    <item>
      <title>Re: Hide Autocad activity while VBA program is in progress</title>
      <link>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/7603003#M65668</link>
      <description>&lt;P&gt;your code is not working for me.&amp;nbsp; I gave up and just decided to use&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;acadApp.WindowState = acMin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have any pointers when using your code?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2017 22:55:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/7603003#M65668</guid>
      <dc:creator>jeremye86</dc:creator>
      <dc:date>2017-12-06T22:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: Hide Autocad activity while VBA program is in progress</title>
      <link>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/7605149#M65669</link>
      <description>&lt;P&gt;Try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Declare &lt;FONT color="#3366FF"&gt;PtrSafe&lt;/FONT&gt; Function LockWindowUpdate Lib "user32" (ByVal hwndLock As Long) As Long&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2017 15:34:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/7605149#M65669</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2017-12-07T15:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: Hide Autocad activity while VBA program is in progress</title>
      <link>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/7605918#M65670</link>
      <description>&lt;P&gt;Ed,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am already using this and it works fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#If VBA7 And Win64 Then&lt;BR /&gt;Public Declare PtrSafe Function LockWindowUpdate Lib "user32" (ByVal hwndLock As LongPtr) As Long&lt;BR /&gt;#Else&lt;BR /&gt;Public Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As Long) As Long&lt;BR /&gt;#End If&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only problem is im not sure what to put inside the function&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LockWindowUpdate (???????.Hwnd)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;right now i am doing this&lt;/P&gt;&lt;P&gt;Set acadApp = GetObject(, "AutoCAD.Application")&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LockWindowUpdate (acadApp&lt;/SPAN&gt;&lt;SPAN&gt;.Hwnd)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;it seems to be working but the only thing it is hiding in the screen update is&amp;nbsp;&lt;/SPAN&gt;this&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;acadApp.Application.Documents.Add&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;where i don't see the additional document windows pop up&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But i still see the actual drawing window doing screen updates (which i need turned off)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2017 19:14:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/7605918#M65670</guid>
      <dc:creator>jeremye86</dc:creator>
      <dc:date>2017-12-07T19:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: Hide Autocad activity while VBA program is in progress</title>
      <link>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/7605938#M65671</link>
      <description>&lt;P&gt;Use the handle of the document, ThisDrawing.HWND.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit, I see you might be running this from another app. Set a variable to the active document.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dim oDoc as AcadDocument&lt;/P&gt;
&lt;P&gt;Set oDoc = acadApp.ActiveDocument&lt;/P&gt;
&lt;P&gt;LockWindowUpdate(oDoc.HWND)&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2017 19:24:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/7605938#M65671</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2017-12-07T19:24:38Z</dc:date>
    </item>
    <item>
      <title>Re: Hide Autocad activity while VBA program is in progress</title>
      <link>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/7606010#M65672</link>
      <description>&lt;P&gt;Ed,&lt;/P&gt;&lt;P&gt;You are correct, i am running the code from excel.&lt;/P&gt;&lt;P&gt;Unfortunately, what you just suggested is causing excel to crash and shut down.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is interesting, when i change &lt;FONT color="#FF0000"&gt;Dim oDoc as AcadDocument&lt;/FONT&gt; to &lt;FONT color="#FF0000"&gt;Dim oDoc as&amp;nbsp;object&lt;/FONT&gt; it does not crash, but i don't see the&amp;nbsp;&lt;SPAN&gt;LockWindowUpdate&lt;/SPAN&gt; function working correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2017 19:44:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/7606010#M65672</guid>
      <dc:creator>jeremye86</dc:creator>
      <dc:date>2017-12-07T19:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: Hide Autocad activity while VBA program is in progress</title>
      <link>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/7606015#M65673</link>
      <description>&lt;P&gt;It would seem that you don't have the correct AutoCAD tlb referenced in Excel. Set a breakpoint in Excel and see which line causes the crash. It also sounds like you don't have any error checking in your sub. You should be getting an error to the effect "Can't create object" or something similar.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2017 19:48:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/7606015#M65673</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2017-12-07T19:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: Hide Autocad activity while VBA program is in progress</title>
      <link>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/7606054#M65674</link>
      <description>&lt;P&gt;it crashes right when i step into the procedure.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What do you mean 'you don't have the correct AutoCAD tlb referenced'?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2017 19:58:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/7606054#M65674</guid>
      <dc:creator>jeremye86</dc:creator>
      <dc:date>2017-12-07T19:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: Hide Autocad activity while VBA program is in progress</title>
      <link>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/7606105#M65675</link>
      <description>&lt;P&gt;&lt;FONT color="#3366FF"&gt;it crashes right when i step into the procedure&lt;/FONT&gt;.&lt;/P&gt;
&lt;P class="1512677365571"&gt;&amp;nbsp;Do you have your breakpoint at the beginning of the sub?&lt;/P&gt;
&lt;P class="1512677365571"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="1512677365571"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;SPAN&gt;What do you mean 'you don't have the correct AutoCAD tlb referenced'?&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;If you are going to to use AutoCAD objects you have to reference its type library (*.tlb). Go to Tools&amp;gt;References and check the appropriate tlb for your version of AutoCAD. I thought you might be using an older reference.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2017 20:13:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/7606105#M65675</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2017-12-07T20:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: Hide Autocad activity while VBA program is in progress</title>
      <link>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/7606295#M65676</link>
      <description>&lt;P&gt;yes i have it break at the beginning of the sub.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have the error trapping to break on all errors as well.&amp;nbsp; I also have the correct reference for autocad.&amp;nbsp; still no solution&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;this crashes excel&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Dim oDoc as AcadDocument&lt;/P&gt;&lt;P&gt;Set oDoc = acadApp.ActiveDocument&lt;/P&gt;&lt;P&gt;LockWindowUpdate(oDoc.HWND)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;this does not crash excel&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Dim oDoc as&amp;nbsp;object&lt;/P&gt;&lt;P&gt;Set oDoc = acadApp.ActiveDocument&lt;/P&gt;&lt;P&gt;LockWindowUpdate(oDoc.HWND)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2017 21:15:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/7606295#M65676</guid>
      <dc:creator>jeremye86</dc:creator>
      <dc:date>2017-12-07T21:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: Hide Autocad activity while VBA program is in progress</title>
      <link>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/7606552#M65677</link>
      <description>&lt;P&gt;&lt;FONT color="#3366FF"&gt;i have the error trapping to break on all errors as well.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;That's not error handling. Its the responsibility of your sub to determine what should happen when an error occurs. Below is a template of my standard error handling. What error number you should put in your Case..Select is a matter of trial and error. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;Sub Main()
    On Error GoTo Err_Control

    'Do your work here.
    
    
Cleanup:
    Set oDwg = Nothing
    Set oDbx = Nothing
    
Exit_Here:
    Exit Sub
Err_Control:
    Select Case Err.Number
    'Add your Case selections here
    'Case Is = 1000
        'Handle error
        'Err.Clear
        'Resume Exit_Here
    Case Else
        MsgBox Err.Number &amp;amp; ", " &amp;amp; Err.Description, , "Main Title"
        Err.Clear
        Resume Exit_Here
    End Select
End Sub&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After some research, I found this in an &lt;A href="https://blogs.msdn.microsoft.com/oldnewthing/20070222-01/?p=27913/" target="_blank"&gt;MSDN articl&lt;/A&gt;e.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;&lt;CODE&gt;&amp;nbsp;&lt;/CODE&gt;&lt;/P&gt;
&lt;TABLE border="1"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH valign="BASELINE"&gt;Instead of&lt;/TH&gt;
&lt;TD valign="BASELINE"&gt;&lt;CODE&gt;LockWindowUpdate(hwnd)&lt;/CODE&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH valign="BASELINE"&gt;Use&lt;/TH&gt;
&lt;TD valign="BASELINE"&gt;&lt;CODE&gt;SendMessage(hwnd, WM_SETREDRAW, FALSE, 0)&lt;/CODE&gt; or&lt;BR /&gt; &lt;CODE&gt;SetWindowRedraw(hwnd, FALSE)&lt;/CODE&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;TABLE border="1"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH valign="BASELINE"&gt;Instead of&lt;/TH&gt;
&lt;TD valign="BASELINE"&gt;&lt;CODE&gt;LockWindowUpdate(NULL)&lt;/CODE&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH valign="BASELINE"&gt;Use&lt;/TH&gt;
&lt;TD valign="BASELINE"&gt;&lt;CODE&gt;SendMessage(hwnd, WM_SETREDRAW, TRUE, 0)&lt;/CODE&gt; or&lt;BR /&gt; &lt;CODE&gt;SetWindowRedraw(hwnd, TRUE)&lt;/CODE&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/oldnewthing/archive/2007/02/19/1716211.aspx" target="_blank"&gt; As we noted earlier&lt;/A&gt;, only one window in the system can be locked for update at a time. If your intention for calling &lt;CODE&gt;LockWindowUpdate&lt;/CODE&gt; is merely to prevent a window from redrawing, say, because you're updating it and don't want the window continuously refreshing until your update is complete, then just disable redraw on that window. If you use &lt;CODE&gt;LockWindowUpdate&lt;/CODE&gt;, you create a whole slew of subtle problems.&lt;/P&gt;
&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So...&lt;/P&gt;
&lt;PRE&gt;Public Const WM_SETREDRAW = &amp;amp;HB

Declare PtrSafe Function SendMessage Lib "user32" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Any) As Long

'Lock window redraw
SendMessage(oDoc.HWND, WM_SETREDRAW, FALSE, 0)

'Do work here

'Reset window redraw
SendMessage(oDoc.HWND, WM_SETREDRAW, TRUE, 0)&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Dec 2017 23:21:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/7606552#M65677</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2017-12-07T23:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: Hide Autocad activity while VBA program is in progress</title>
      <link>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/7609726#M65678</link>
      <description>&lt;P&gt;thanks Ed for your insights&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this line is giving an error&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;SendMessage(oDoc.HWND, WM_SETREDRAW, FALSE, 0)&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Dec 2017 21:51:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/7609726#M65678</guid>
      <dc:creator>jeremye86</dc:creator>
      <dc:date>2017-12-08T21:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: Hide Autocad activity while VBA program is in progress</title>
      <link>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/7609739#M65679</link>
      <description>&lt;P&gt;Did you implement the error handling I gave you and did you get an error number/description?&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2017 22:00:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/7609739#M65679</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2017-12-08T22:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: Hide Autocad activity while VBA program is in progress</title>
      <link>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/7609744#M65680</link>
      <description>&lt;P&gt;its a syntax error&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2017 22:03:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/7609744#M65680</guid>
      <dc:creator>jeremye86</dc:creator>
      <dc:date>2017-12-08T22:03:08Z</dc:date>
    </item>
    <item>
      <title>Re: Hide Autocad activity while VBA program is in progress</title>
      <link>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/7609820#M65681</link>
      <description>&lt;P&gt;Try changing true/false to vbTrue/vbFalse.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2017 22:56:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/7609820#M65681</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2017-12-08T22:56:40Z</dc:date>
    </item>
    <item>
      <title>Re: Hide Autocad activity while VBA program is in progress</title>
      <link>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/7614278#M65682</link>
      <description>&lt;P&gt;hey Ed, i still get a syntax error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess i need to study up on windows API before i start using it.&amp;nbsp; thanks for all your help&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 17:26:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/7614278#M65682</guid>
      <dc:creator>jeremye86</dc:creator>
      <dc:date>2017-12-11T17:26:24Z</dc:date>
    </item>
    <item>
      <title>Re: Hide Autocad activity while VBA program is in progress</title>
      <link>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/7614292#M65683</link>
      <description>&lt;P&gt;You might have misspelled something or left out an argument. Post your code so we can have a look at it.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 17:31:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/7614292#M65683</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2017-12-11T17:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: Hide Autocad activity while VBA program is in progress</title>
      <link>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/7614321#M65684</link>
      <description>&lt;P&gt;i took out a lot for simplicity but here is the general idea of what i am doing&lt;/P&gt;&lt;PRE&gt;Option Explicit

Public Const WM_SETREDRAW = &amp;amp;HB
#If VBA7 And Win64 Then
Declare PtrSafe Function SendMessage Lib "user32" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _
ByVal lParam As Any) As Long
#Else
Declare Function SendMessage Lib "user32" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _
ByVal lParam As Any) As Long
#End If


Sub open_autocad()

    Dim acadApp As Object
    Dim oDoc As AcadDocument

    'Check if AutoCAD application is open. If it is not opened create a new instance and make it visible.
    On Error Resume Next
    Set acadApp = GetObject(, "AutoCAD.Application")
    acadApp.Visible = True
    If acadApp Is Nothing Then
        Set acadApp = CreateObject("AutoCAD.Application")
        acadApp.Visible = True
    End If
    
    'Check (again) if there is an AutoCAD object.
    If acadApp Is Nothing Then
        MsgBox "Sorry, it was impossible to start AutoCAD!", vbCritical, "AutoCAD Error"
        Exit Sub
    End If

    On Error GoTo 0
  
    acadApp.WindowState = acMax
    

    acadApp.Application.Documents.Add
    Set oDoc = acadApp.ActiveDocument

    
    SendMessage(oDoc.HWND, WM_SETREDRAW, vbfalse, 0)
    
    
    'do work here
    
    acadApp.Application.Documents.Add
    acadApp.Application.Documents.Add
    acadApp.Application.Documents.Add
    acadApp.Application.Documents.Add
 
    SendMessage(oDoc.HWND, WM_SETREDRAW, vbtrue, 0)
 
 
End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 17:41:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/7614321#M65684</guid>
      <dc:creator>jeremye86</dc:creator>
      <dc:date>2017-12-11T17:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: Hide Autocad activity while VBA program is in progress</title>
      <link>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/7614521#M65685</link>
      <description>&lt;P&gt;Try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SendMessage oDoc.HWND, WM_SETREDRAW, 0&amp;amp;, 0&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SendMessage oDoc.HWND, WM_SETREDRAW, 1&amp;amp;, 0&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You only use the parenthesis when the function is on the right side of an equals sign, like when you are setting a variable to the value returned by the function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, I changed the TRUE/FALSE to 1&amp;amp; and 0&amp;amp; because those constants are defined in .NET, but not VBA. vbTrue is a tristate and not quite the same.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 18:50:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/hide-autocad-activity-while-vba-program-is-in-progress/m-p/7614521#M65685</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2017-12-11T18:50:29Z</dc:date>
    </item>
  </channel>
</rss>

