title: Using Microsoft.Office.Interop.Excel without actually having Excel?
body: <p>I'm using <code>Microsoft.Office.Interop.Excel</code> in VB.Net in order to export an .xls file as a .pdf file. This was the only method I could find without relying on third party software to be installed on the running machine or using an expensive add-on to Visual Studio. This method requires opening excel and saving a file through the code. </p>
  
  <p>My problem is that I only have a trial version of Microsoft office as I never actually use it. Well the limitation of times I can open it is up as I have run the program enough times for debugging purposes and now I can't continue development on this application. Is there a development kit for visual studio that provides the API I need for this functionality without actually having Office installed? I don't need Microsoft Office so I don't want to have to buy a full version just to develop and test an application.</p>
  
  <p>I've looked at some options like <a href="https://stackoverflow.com/questions/1369361/how-can-i-programatically-create-read-write-an-excel-without-having-office-inst">this</a>, but there is very specific formatting that needs to remain intact in the .xls for the conversion to .pdf that doesn't seem to work if I use an intermediary format.</p>
  
  <p>I've also read a little bit about the openOffice API, but is that compatible with .Net? If so, can someone point me to a tutorial that explains how to use the API with .Net? Specifically VB if possible, but I can work with C# code.</p>
  
  <p>Here is a sample of what I am trying to do, in case it helps with suggestions:</p>
  
  <pre><code>        Dim fileName As String = AppDomain.CurrentDomain.BaseDirectory &amp; "LOA " &amp; compName.Text &amp; ".xls"
          Dim xlsApp = New Microsoft.Office.Interop.Excel.Application
          xlsApp.ScreenUpdating = False
          Dim xlsBook As Microsoft.Office.Interop.Excel.Workbook
          Dim paramExportFormat As XlFixedFormatType = XlFixedFormatType.xlTypePDF
          Dim paramExportQuality As XlFixedFormatQuality = XlFixedFormatQuality.xlQualityStandard
          Dim paramOpenAfterPublish As Boolean = False
          Dim paramIncludeDocProps As Boolean = True
          Dim paramIgnorePrintAreas As Boolean = True
          Dim paramFromPage As Object = Type.Missing
          Dim paramToPage As Object = Type.Missing
          xlsBook = xlsApp.Workbooks.Open(fileName, UpdateLinks:=False, ReadOnly:=False)
          xlsBook.ExportAsFixedFormat(paramExportFormat, AppDomain.CurrentDomain.BaseDirectory &amp; "LOA " &amp; compName.Text &amp; ".pdf", paramExportQuality, paramIncludeDocProps, paramIgnorePrintAreas, paramFromPage, paramToPage, paramOpenAfterPublish)
          xlsBook.Close(SaveChanges:=False)
          xlsApp.Quit()
  </code></pre>