Message 1 of 17
VBA ExportLayout & How To Skip Open Message Box
Not applicable
02-25-2020
06:20 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi yall,
Created an "Export Layout" snippet of code.
My code below works, however how do stop/disable the "Open Message Box" prompt from popping up at the end or force "Do not Open" (See the picture).
I eventually want to loop through a folder of drawings, and this will undoubtedly prevent me from doing so since this prompt requires a manual input.
I appreciate the help in advance.
OJ
Public Sub ExportToLayout() 'ACAD Main Application Dim oACADApp As AutoCAD.AcadApplication Set oACADApp = GetObject(, "AutoCAD.Application") 'Master Active Document Dim oMasterDwgDoc As AcadDocument Set oMasterDwgDoc = oACADApp.ActiveDocument
'Background Ops oMasterDwgDoc.SetVariable "FILEDIA", 0 oMasterDwgDoc.SetVariable "BACKGROUNDPLOT", 0 Dim oSaveLocation As String: oSaveLocation = "D:\SampleLocation\NewExported.dwg" 'Send Export Command oMasterDwgDoc.SendCommand "EXPORTLAYOUT" & vbCr & oSaveLocation & vbCr '& 'Chr(27) -ESC End Sub