<?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: save xlsx as pdf in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/save-xlsx-as-pdf/m-p/8508061#M92980</link>
    <description>&lt;P&gt;GoExcel automates portions of the Excel Interop API.&amp;nbsp; with the Excel object and the ws (worksheet) object this is the complete Excel Interop method (vb.net) to print/save PDF from Excel using its built in PDF driver.&lt;/P&gt;
&lt;PRE&gt; Try
                ws.PageSetup.PrintArea = rngTable.Address
            Catch ex As Exception
                MsgBox("Error setting print area to table size.")
            End Try
            Try
                ExcelApp.PrintCommunication = False
            Catch ex As Exception

            End Try
            Try
                ws.PageSetup.Zoom = False
            Catch ex As Exception
                MsgBox("Error setting page setup zoom mode to false.")
            End Try
            Try
                ws.PageSetup.FitToPagesWide = 1
            Catch ex As Exception
                MsgBox("Error setting page setup fit to pages wide to 1.")
            End Try
            Try
                ws.PageSetup.FitToPagesTall = 0
            Catch ex As Exception
                MsgBox("Error setting page setup fit to pages tall to auto (0).")
            End Try
            Try
                ExcelApp.PrintCommunication = True
            Catch ex As Exception

            End Try
            'save file
            If Not String.IsNullOrWhiteSpace(DrawingListPath) Then
                If System.IO.Directory.Exists(System.IO.Path.GetDirectoryName(DrawingListPath)) = False Then
                    System.IO.Directory.CreateDirectory(System.IO.Path.GetDirectoryName(DrawingListPath))
                End If
                If WorkFile.Exists Then
                    WorkFile.Delete()
                    WorkFile.Refresh()
                End If
                wb.SaveAs(DrawingListPath, , , , , , , Excel.XlSaveConflictResolution.xlUserResolution)
                'print table to pdf
                ws.ExportAsFixedFormat(Excel.XlFixedFormatType.xlTypePDF, WorkFile.FullName, Excel.XlFixedFormatQuality.xlQualityStandard, True, False, , , False)
                wb.Close()
                           End If&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;WorkFile is an instance of the class System.IO.FileInfo, and since there are many ways Excel can kick back errors I have many try catch blocks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 08 Jan 2019 17:17:48 GMT</pubDate>
    <dc:creator>JamieVJohnson2</dc:creator>
    <dc:date>2019-01-08T17:17:48Z</dc:date>
    <item>
      <title>save xlsx as pdf</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/save-xlsx-as-pdf/m-p/8507558#M92955</link>
      <description>&lt;P&gt;Is it possible to save xlsx as pdf from Inventor 2019? (VBA?)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class=""&gt;To make it clear, I exported some parameters to xlsx file then i save it, and now i'd like to save it as pdf directly from Inventor (maybe i want too much &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@B4D44A73814D7FC0D950DEDFACB97081/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt; ) &lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SyntaxEditor Code Snippet&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN style="color: #800080;"&gt;GoExcel&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;CellValue&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"filename.xlsx"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Sheet1"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"A2"&lt;/SPAN&gt;)= "whatever"&lt;/PRE&gt;
&lt;P&gt;SyntaxEditor Code Snippet&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN style="color: #800080;"&gt;GoExcel&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;Save&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2019 14:52:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/save-xlsx-as-pdf/m-p/8507558#M92955</guid>
      <dc:creator>mblaptok</dc:creator>
      <dc:date>2019-01-08T14:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: save xlsx as pdf</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/save-xlsx-as-pdf/m-p/8508061#M92980</link>
      <description>&lt;P&gt;GoExcel automates portions of the Excel Interop API.&amp;nbsp; with the Excel object and the ws (worksheet) object this is the complete Excel Interop method (vb.net) to print/save PDF from Excel using its built in PDF driver.&lt;/P&gt;
&lt;PRE&gt; Try
                ws.PageSetup.PrintArea = rngTable.Address
            Catch ex As Exception
                MsgBox("Error setting print area to table size.")
            End Try
            Try
                ExcelApp.PrintCommunication = False
            Catch ex As Exception

            End Try
            Try
                ws.PageSetup.Zoom = False
            Catch ex As Exception
                MsgBox("Error setting page setup zoom mode to false.")
            End Try
            Try
                ws.PageSetup.FitToPagesWide = 1
            Catch ex As Exception
                MsgBox("Error setting page setup fit to pages wide to 1.")
            End Try
            Try
                ws.PageSetup.FitToPagesTall = 0
            Catch ex As Exception
                MsgBox("Error setting page setup fit to pages tall to auto (0).")
            End Try
            Try
                ExcelApp.PrintCommunication = True
            Catch ex As Exception

            End Try
            'save file
            If Not String.IsNullOrWhiteSpace(DrawingListPath) Then
                If System.IO.Directory.Exists(System.IO.Path.GetDirectoryName(DrawingListPath)) = False Then
                    System.IO.Directory.CreateDirectory(System.IO.Path.GetDirectoryName(DrawingListPath))
                End If
                If WorkFile.Exists Then
                    WorkFile.Delete()
                    WorkFile.Refresh()
                End If
                wb.SaveAs(DrawingListPath, , , , , , , Excel.XlSaveConflictResolution.xlUserResolution)
                'print table to pdf
                ws.ExportAsFixedFormat(Excel.XlFixedFormatType.xlTypePDF, WorkFile.FullName, Excel.XlFixedFormatQuality.xlQualityStandard, True, False, , , False)
                wb.Close()
                           End If&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;WorkFile is an instance of the class System.IO.FileInfo, and since there are many ways Excel can kick back errors I have many try catch blocks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2019 17:17:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/save-xlsx-as-pdf/m-p/8508061#M92980</guid>
      <dc:creator>JamieVJohnson2</dc:creator>
      <dc:date>2019-01-08T17:17:48Z</dc:date>
    </item>
  </channel>
</rss>

