<?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: Using the Office Primary Interop Assemblies with ArcGIS Pro addins in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/using-the-office-primary-interop-assemblies-with/m-p/1305865#M10012</link>
    <description>&lt;P&gt;i would recommend using ClosedXML:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.nuget.org/packages/ClosedXML" target="_blank"&gt;NuGet Gallery | ClosedXML 0.102.0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/ClosedXML/ClosedXML" target="_blank"&gt;ClosedXML/ClosedXML: ClosedXML is a .NET library for reading, manipulating and writing Excel 2007+ (.xlsx, .xlsm) files. It aims to provide an intuitive and user-friendly interface to dealing with the underlying OpenXML API. (github.com)&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 05 Jul 2023 17:29:24 GMT</pubDate>
    <dc:creator>Wolf</dc:creator>
    <dc:date>2023-07-05T17:29:24Z</dc:date>
    <item>
      <title>Using the Office Primary Interop Assemblies with ArcGIS Pro addins</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/using-the-office-primary-interop-assemblies-with/m-p/1305825#M10011</link>
      <description>&lt;P&gt;I need to create Excel spreadsheets while inside an ArcGIS Pro Addin Button. Can't seem to get it to work like it did in the 'old' days with ArcObjects. Here's a short Button module that fails... This code is using the Office Primary Interop Assemblies reference.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Imports System&lt;BR /&gt;Imports System.Collections.Generic&lt;BR /&gt;Imports System.Linq&lt;BR /&gt;Imports System.Text&lt;BR /&gt;Imports System.Threading.Tasks&lt;BR /&gt;Imports ArcGIS.Core.CIM&lt;BR /&gt;Imports ArcGIS.Core.Data&lt;BR /&gt;Imports ArcGIS.Core.Geometry&lt;BR /&gt;Imports ArcGIS.Desktop.Catalog&lt;BR /&gt;Imports ArcGIS.Desktop.Core&lt;BR /&gt;Imports ArcGIS.Desktop.Editing&lt;BR /&gt;Imports ArcGIS.Desktop.Extensions&lt;BR /&gt;Imports ArcGIS.Desktop.Framework&lt;BR /&gt;Imports ArcGIS.Desktop.Framework.Contracts&lt;BR /&gt;Imports ArcGIS.Desktop.Framework.Dialogs&lt;BR /&gt;Imports ArcGIS.Desktop.Framework.Threading.Tasks&lt;BR /&gt;Imports ArcGIS.Desktop.Layouts&lt;BR /&gt;Imports ArcGIS.Desktop.Mapping&lt;BR /&gt;Imports Microsoft.Office.Interop&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Friend Class Button1&lt;BR /&gt;Inherits Button&lt;/P&gt;&lt;P&gt;Private oExcelApp As Microsoft.Office.Interop.Excel.Application = New Microsoft.Office.Interop.Excel.Application&lt;/P&gt;&lt;P&gt;Protected Overrides Sub OnClick()&lt;/P&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;' oExcelApp = New Microsoft.Office.Interop.Excel.Application&lt;/P&gt;&lt;P&gt;Dim xlsServiceListingWorkbook As Microsoft.Office.Interop.Excel.Workbook&lt;BR /&gt;xlsServiceListingWorkbook = oExcelApp.Workbooks.Add&lt;/P&gt;&lt;P&gt;MsgBox("here")&lt;/P&gt;&lt;P&gt;Catch ex As Exception&lt;BR /&gt;MsgBox(ex.ToString)&lt;/P&gt;&lt;P&gt;End Try&lt;/P&gt;&lt;P&gt;End Sub&lt;BR /&gt;End Class&lt;/P&gt;&lt;P&gt;Here's the highlights of the error caught in the exception...&lt;/P&gt;&lt;P&gt;Unable to cast COM object of type 'Microsoft.Office.Interop.Excel.ApplicationClass' to interface type 'Microsoft.Office.Interop.Excel._Application'.&amp;nbsp; ......&amp;nbsp; Element not found (0x8002802B).&lt;/P&gt;&lt;P&gt;The error is thrown at&amp;nbsp;xlsServiceListingWorkbook = oExcelApp.Workbooks.Add.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is using COM assembly references a 'no-no' in Pro buttons?&amp;nbsp;&lt;/P&gt;&lt;P&gt;What would be the best way to read/write spreadsheets from inside the Pro Button code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2023 16:47:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/using-the-office-primary-interop-assemblies-with/m-p/1305825#M10011</guid>
      <dc:creator>FenuxLabs</dc:creator>
      <dc:date>2023-07-05T16:47:55Z</dc:date>
    </item>
    <item>
      <title>Re: Using the Office Primary Interop Assemblies with ArcGIS Pro addins</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/using-the-office-primary-interop-assemblies-with/m-p/1305865#M10012</link>
      <description>&lt;P&gt;i would recommend using ClosedXML:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.nuget.org/packages/ClosedXML" target="_blank"&gt;NuGet Gallery | ClosedXML 0.102.0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/ClosedXML/ClosedXML" target="_blank"&gt;ClosedXML/ClosedXML: ClosedXML is a .NET library for reading, manipulating and writing Excel 2007+ (.xlsx, .xlsm) files. It aims to provide an intuitive and user-friendly interface to dealing with the underlying OpenXML API. (github.com)&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2023 17:29:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/using-the-office-primary-interop-assemblies-with/m-p/1305865#M10012</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2023-07-05T17:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: Using the Office Primary Interop Assemblies with ArcGIS Pro addins</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/using-the-office-primary-interop-assemblies-with/m-p/1320922#M10219</link>
      <description>&lt;P&gt;&amp;nbsp;I'm having trouble getting ClosedXML working in an ArcGIS Pro 3.0.3 Addin. I'm still testing different options, so hopefully someone has a solution.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2023 21:18:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/using-the-office-primary-interop-assemblies-with/m-p/1320922#M10219</guid>
      <dc:creator>AzharIbrahim</dc:creator>
      <dc:date>2023-08-21T21:18:36Z</dc:date>
    </item>
  </channel>
</rss>

