<?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: Interop Excel error in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/interop-excel-error/m-p/3824150#M50393</link>
    <description>&lt;P&gt;Hi H&lt;SPAN&gt;allex,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;All data transfer to excel successfully, however&amp;nbsp;&lt;SPAN&gt;There's a message "Object reference not set to an instance an object.".&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Please let me know what happen.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 05 Apr 2013 02:28:30 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-04-05T02:28:30Z</dc:date>
    <item>
      <title>Interop Excel error</title>
      <link>https://forums.autodesk.com/t5/net-forum/interop-excel-error/m-p/3813498#M50385</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know what happen? Error occurred when COM interop Autocad 2012 with excel 2010.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG border="0" align="center" title="3-25-2013 2-03-52 PM.png" alt="3-25-2013 2-03-52 PM.png" src="https://forums.autodesk.com/t5/image/serverpage/image-id/49240i0FA305ADA680AD2B/image-size/original?v=mpbl-1&amp;amp;px=-1" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2013 07:24:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/interop-excel-error/m-p/3813498#M50385</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-03-25T07:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: Interop Excel error</title>
      <link>https://forums.autodesk.com/t5/net-forum/interop-excel-error/m-p/3813514#M50386</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what code does that message case?&lt;/P&gt;&lt;P&gt;What operating system and what office do you use (e.g. 64bit os ... and so 64bit AutoCAD and maybe 32bit Office)?&lt;/P&gt;&lt;P&gt;And the content of the message (the text under details) might also be necessary, so copy the whole text into a text-file and upload it here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- alfred -&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2013 08:10:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/interop-excel-error/m-p/3813514#M50386</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2013-03-25T08:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: Interop Excel error</title>
      <link>https://forums.autodesk.com/t5/net-forum/interop-excel-error/m-p/3813543#M50387</link>
      <description>&lt;P&gt;Yes. My computer use&amp;nbsp;&lt;SPAN&gt;64bit AutoCAD 2012-English SP2 and 32bit Excel V14.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is full detail:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;---------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;See the end of this message for details on invoking&lt;BR /&gt;just-in-time (JIT) debugging instead of this dialog box.&lt;/P&gt;&lt;P&gt;************** Exception Text **************&lt;BR /&gt;System.Runtime.InteropServices.COMException (0x80004023): Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80004023 A Microsoft Software Installer error was encountered. (Exception from HRESULT: 0x80004023).&lt;BR /&gt;at System.Runtime.Remoting.RemotingServices.AllocateUninitializedObject(RuntimeType objectType)&lt;BR /&gt;at System.Runtime.Remoting.Activation.ActivationServices.CreateInstance(RuntimeType serverType)&lt;BR /&gt;at System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK(RuntimeType serverType, Object[] props, Boolean bNewObj)&lt;BR /&gt;at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean&amp;amp; canBeCached, RuntimeMethodHandleInternal&amp;amp; ctor, Boolean&amp;amp; bNeedSecurityCheck)&lt;BR /&gt;at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)&lt;BR /&gt;at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache)&lt;BR /&gt;at System.Activator.CreateInstance(Type type, Boolean nonPublic)&lt;BR /&gt;at Color_tool.Module1.GetExcelData()&lt;BR /&gt;at Color_tool.Color_tool.MyCommand.Link_Excel_Copy()&lt;BR /&gt;at Autodesk.AutoCAD.Runtime.CommandClass.InvokeWorker(MethodInfo mi, Object commandObject, Boolean bLispFunction)&lt;BR /&gt;at Autodesk.AutoCAD.Runtime.CommandClass.InvokeWorkerWithExceptionFilter(MethodInfo mi, Object commandObject, Boolean bLispFunction)&lt;BR /&gt;at Autodesk.AutoCAD.Runtime.PerDocumentCommandClass.Invoke(MethodInfo mi, Boolean bLispFunction)&lt;BR /&gt;at Autodesk.AutoCAD.Runtime.CommandClass.CommandThunk.Invoke()&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;************** Loaded Assemblies **************&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2013 09:37:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/interop-excel-error/m-p/3813543#M50387</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-03-25T09:37:10Z</dc:date>
    </item>
    <item>
      <title>Re: Interop Excel error</title>
      <link>https://forums.autodesk.com/t5/net-forum/interop-excel-error/m-p/3813553#M50388</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and what is the code-snippet that brings up that exception?&lt;/P&gt;&lt;P&gt;And have you tried/looked at that: &lt;A target="_self" href="https://www.google.com/search?q=A+Microsoft+Software+Installer+error+was+encountered&amp;amp;ie=utf-8&amp;amp;oe=utf-8&amp;amp;aq=t&amp;amp;rls=org.mozilla:de:official&amp;amp;client=firefox-a&amp;amp;channel=rcs"&gt;&amp;gt;&amp;gt;&amp;gt;click&amp;lt;&amp;lt;&amp;lt;&lt;/A&gt;? (as this is the message within your report)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- alfred -&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2013 09:43:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/interop-excel-error/m-p/3813553#M50388</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2013-03-25T09:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: Interop Excel error</title>
      <link>https://forums.autodesk.com/t5/net-forum/interop-excel-error/m-p/3813622#M50389</link>
      <description>&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;I still don't know how to solve my problem.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2013 11:56:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/interop-excel-error/m-p/3813622#M50389</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-03-25T11:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: Interop Excel error</title>
      <link>https://forums.autodesk.com/t5/net-forum/interop-excel-error/m-p/3813625#M50390</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT color="#666699"&gt;&amp;gt;&amp;gt; I still don't know how to solve my problem.&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Maybe someone is able to do that, but for me: I need to look at the code-snippet to (hopefully) see what's wrong.&lt;/P&gt;&lt;P&gt;Without a code-line knowing what you are doing wrong is quite hard, don't you think so?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- alfred -&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2013 12:06:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/interop-excel-error/m-p/3813625#M50390</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2013-03-25T12:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: Interop Excel error</title>
      <link>https://forums.autodesk.com/t5/net-forum/interop-excel-error/m-p/3814487#M50391</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I'm sorry for misunderstanding your idea.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;OK. Attachment is all my code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2013 00:59:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/interop-excel-error/m-p/3814487#M50391</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-03-26T00:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: Interop Excel error</title>
      <link>https://forums.autodesk.com/t5/net-forum/interop-excel-error/m-p/3814567#M50392</link>
      <description>&lt;P&gt;Try this code, change to your suit before&lt;/P&gt;&lt;PRE&gt;    '' Working example
Imports System.IO
Imports System.Reflection
Imports System.Runtime.InteropServices
Imports System.Globalization
Imports System.Threading
Imports Microsoft.Office.Interop.Excel
Imports Excel = Microsoft.Office.Interop.Excel
    '' References -&amp;gt; COM -&amp;gt; Microsoft.Excel XX.0 Object Library
    ''' &amp;lt;summary&amp;gt;
    ''' Export one-dimensional array to Excel column
    ''' &amp;lt;/summary&amp;gt;
    ''' &amp;lt;param name="sender"&amp;gt;&amp;lt;/param&amp;gt;
    ''' &amp;lt;param name="e"&amp;gt;&amp;lt;/param&amp;gt;
    ''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim oldCult = CultureInfo.CurrentCulture()
        '' This line is very important!
        Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US") '&amp;lt;-- change culture on whatever you need
        Dim miss As Object = Type.Missing 'System.Reflection.Missing.Value
        Dim i As Integer
        Dim textfile As String = "C:\Test\MyCodes.txt"
        If (Not File.Exists(textfile)) Then
            MessageBox.Show("File does not exists")
            Return
        End If
        '' Open Excel
        Dim m_objExcel As Excel.Application = New Excel.Application
        m_objExcel.Visible = True
        m_objExcel.UserControl = True
        Dim m_objBooks As Excel.Workbooks = CType(m_objExcel.Workbooks, Excel.Workbooks)
        Dim m_objBook As Excel.Workbook = Nothing
        Try
            '' Open workbook

            m_objBooks.Open("C:\Test\Invoices.xlsx", False, False, miss, "", miss, miss, Excel.XlPlatform.xlWindows, miss, miss, miss, miss, miss, miss, miss)

            m_objBook = m_objExcel.ActiveWorkbook
            m_objBook.Activate() 'optional
            Dim m_objSheets As Sheets = m_objBook.Sheets
            Dim m_objSheet As Worksheet = m_objSheets.Item(1) '&amp;lt;--"Sheet1"
            m_objSheet.Cells.ClearContents() 'optional may to remove this line
            Dim m_objCells As Range = m_objSheet.Cells
            Dim m_objRange As Range = Nothing
            If IO.File.Exists(textfile) Then
                'Create a StreamReader and open our text file
                Using pars As New StreamReader(textfile)
                    i = 1
                    'Now add our columns (we will check to make sure the column doesnt exist before adding it)
                    While Not pars.EndOfStream
                        Dim line As String = pars.ReadLine
                        '' write data starting from cell "A1"

                        m_objRange = m_objSheet.Range(m_objCells(i, 1), m_objCells(i, 1))
                        m_objRange.NumberFormat = "@"
                        m_objRange.Value2 = line

                        i += 1
                    End While
                End Using

            End If
            '' optional just for debug only
            m_objSheet.Range(m_objCells(1, 1), m_objCells(i - 1, 1)).Select()
            m_objRange = m_objSheet.Range(m_objCells(1, 1), m_objCells(i - 1, 1))

            m_objRange.BorderAround(Excel.XlLineStyle.xlContinuous, _
                    Excel.XlBorderWeight.xlMedium, Excel.XlColorIndex.xlColorIndexAutomatic, Excel.XlColorIndex.xlColorIndexAutomatic)
            m_objSheet.Columns.AutoFit()
            '' Save the file in the typical workbook format
            m_objBook.SaveAs("C:\Test\numbers.xlsx", Excel.XlFileFormat.xlWorkbookDefault, "", "", False, False, XlSaveAsAccessMode.xlNoChange, miss, miss, miss, miss, miss)

        Catch ex As System.Exception
            MessageBox.Show(ex.Message &amp;amp; vbCrLf &amp;amp; ex.StackTrace)
        Finally
            '' close workbook and quit Excel
            If Not m_objBook Is Nothing Then
                m_objBook.Close(False, miss, miss)
                m_objBook = Nothing
            End If
            m_objExcel.Quit()
            '' release process if it's still active
            System.Runtime.InteropServices.Marshal.FinalReleaseComObject(m_objExcel)
            Thread.CurrentThread.CurrentCulture = oldCult
        End Try
    End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2013 06:09:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/interop-excel-error/m-p/3814567#M50392</guid>
      <dc:creator>Hallex</dc:creator>
      <dc:date>2013-03-26T06:09:43Z</dc:date>
    </item>
    <item>
      <title>Re: Interop Excel error</title>
      <link>https://forums.autodesk.com/t5/net-forum/interop-excel-error/m-p/3824150#M50393</link>
      <description>&lt;P&gt;Hi H&lt;SPAN&gt;allex,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;All data transfer to excel successfully, however&amp;nbsp;&lt;SPAN&gt;There's a message "Object reference not set to an instance an object.".&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Please let me know what happen.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2013 02:28:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/interop-excel-error/m-p/3824150#M50393</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-04-05T02:28:30Z</dc:date>
    </item>
  </channel>
</rss>

