title: Print NanoCAD DWG files to PDF
body: <p>I want to print DWG files from Excel VBA to PDF. There is a lot of help for AutoCAD, but little or none found for NanoCAD. I tried using equivalent functions, but results in error.</p>
  <p>A little background on what I have explored.</p>
  <ol>
  <li><p>Print configuration DWG2PDF.pc3 created in NanoCAd and the following code :</p>
  <pre><code> Dim NCAD As nanocad.Application
   Dim ndg As nanocad.Document
   Dim pth As String
   Dim result As String  
   pth = ThisWorkbook.Path
   Set NCAD = GetObject(&quot;&quot;, &quot;nanoCAD.Application&quot;)
   NCAD.Visible = True
   Set ndg = NCAD.Documents.Open(pth &amp; &quot;\typicals\Title-OPA01.dwg&quot;)
   ndg.ActiveLayout.ConfigName = &quot;DWG2PDF.pc3&quot;
   result = ndg.Plot.PlotToFile(pth &amp; &quot;\Output\op.pdf&quot;)
  </code></pre>
  </li>
  </ol>
  <p>I used the command specified for autoCAD professional version and not LT. Is there a workaround in AutoCAD LT which I can adapt to NanoCAD?</p>
  <ol start="2">
  <li><p>Second trial through Acrobat's print function which windows calls for printing to PDF. Got help from Internet on calling the Shell command. I used some code as below.</p>
  <p>call Shell (&quot;C:\Program Files\Adobe\Acrobat 8.0\Acrobat\Acrobat.exe /p/h&quot; &amp; pth &amp; &quot;\typicals\Title-OPA01.dwg&quot;)</p>
  </li>
  </ol>
  <p>Note: I referenced the type library of NanoCAD, Acrobat into the VBA project.</p>