<?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: Change source of 3rd party spreadsheet. in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/change-source-of-3rd-party-spreadsheet/m-p/2435527#M148105</link>
    <description>&lt;DIV id="jive-html-wrapper-div"&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;You are missing&amp;nbsp;the 'Call' keyword in the &lt;BR /&gt;
following line:&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;oFileDesc.ReplaceReference (Temp)&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;should be:&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;Call oFileDesc.ReplaceReference (Temp)&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;This is a VB syntax oddity&amp;nbsp;that has been &lt;BR /&gt;
addressed in VB.NET.&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Sanjay-&lt;/FONT&gt;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
    <pubDate>Tue, 24 Feb 2009 01:10:08 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2009-02-24T01:10:08Z</dc:date>
    <item>
      <title>Change source of 3rd party spreadsheet.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/change-source-of-3rd-party-spreadsheet/m-p/2435525#M148103</link>
      <description>Hello,</description>
      <pubDate>Mon, 23 Feb 2009 14:45:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/change-source-of-3rd-party-spreadsheet/m-p/2435525#M148103</guid>
      <dc:creator>herrwolf1</dc:creator>
      <dc:date>2009-02-23T14:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: Change source of 3rd party spreadsheet.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/change-source-of-3rd-party-spreadsheet/m-p/2435526#M148104</link>
      <description>Anyways,&lt;BR /&gt;
    Tab apparently goes straight to "Post Message" &lt;BR /&gt;
&lt;BR /&gt;
To my problem.&lt;BR /&gt;
    The following code worked fine before I installed SP1. Can anyone spread some light onto what a solution might be.&lt;BR /&gt;
&lt;BR /&gt;
Sub ChangeSource()&lt;BR /&gt;
    Dim oDoc As Document&lt;BR /&gt;
    Dim oFile As File&lt;BR /&gt;
    Dim oFileDesc As FileDescriptor&lt;BR /&gt;
    Dim Temp As String&lt;BR /&gt;
    &lt;BR /&gt;
    Set oDoc = ThisApplication.ActiveDocument&lt;BR /&gt;
    Set oFile = oDoc.File&lt;BR /&gt;
 &lt;BR /&gt;
    For Each oFileDesc In oFile.ReferencedFileDescriptors&lt;BR /&gt;
        If oFileDesc.FullFileName = MasterForm.lblPath.Caption &amp;amp; "\" &amp;amp; MasterForm.lblSpreadsheet.Caption Then&lt;BR /&gt;
            Temp = MasterForm.lblPath.Caption &amp;amp; "\" &amp;amp; MasterForm.lblSpreadsheet.Caption&lt;BR /&gt;
            oFileDesc.ReplaceReference (Temp) ' The code breaks here&lt;BR /&gt;
        End If&lt;BR /&gt;
    Next&lt;BR /&gt;
End Sub</description>
      <pubDate>Mon, 23 Feb 2009 14:51:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/change-source-of-3rd-party-spreadsheet/m-p/2435526#M148104</guid>
      <dc:creator>herrwolf1</dc:creator>
      <dc:date>2009-02-23T14:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: Change source of 3rd party spreadsheet.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/change-source-of-3rd-party-spreadsheet/m-p/2435527#M148105</link>
      <description>&lt;DIV id="jive-html-wrapper-div"&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;You are missing&amp;nbsp;the 'Call' keyword in the &lt;BR /&gt;
following line:&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;oFileDesc.ReplaceReference (Temp)&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;should be:&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;Call oFileDesc.ReplaceReference (Temp)&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;This is a VB syntax oddity&amp;nbsp;that has been &lt;BR /&gt;
addressed in VB.NET.&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Sanjay-&lt;/FONT&gt;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 24 Feb 2009 01:10:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/change-source-of-3rd-party-spreadsheet/m-p/2435527#M148105</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-02-24T01:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: Change source of 3rd party spreadsheet.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/change-source-of-3rd-party-spreadsheet/m-p/2435528#M148106</link>
      <description>Hello Sanjay,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I tried adding the Call keyword. It didn't work. Here is the error I get:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Run-time error '-2147467259 (80004005)':&lt;BR /&gt;&lt;BR /&gt;Method 'ReplaceReference' of object ' _IRxFileDescriptor' failed&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Perhaps I have other problems.</description>
      <pubDate>Tue, 24 Feb 2009 14:36:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/change-source-of-3rd-party-spreadsheet/m-p/2435528#M148106</guid>
      <dc:creator>herrwolf1</dc:creator>
      <dc:date>2009-02-24T14:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: Change source of 3rd party spreadsheet.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/change-source-of-3rd-party-spreadsheet/m-p/2435529#M148107</link>
      <description>&lt;DIV id="jive-html-wrapper-div"&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Hmm, I tried again and it works for me. Are you on &lt;BR /&gt;
Inventor 2009? Perhaps you have an incorrect filepath to your &lt;BR /&gt;
spreadsheet?&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Also, if you intend to change the source of the &lt;BR /&gt;
spreadsheet linked via the Parameters dialog, there is another way:&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Sub ChangeExcelSource()&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oDoc As &lt;BR /&gt;
PartDocument&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oDoc = &lt;BR /&gt;
ThisApplication.ActiveDocument&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim &lt;BR /&gt;
oDef As PartComponentDefinition&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oDef = &lt;BR /&gt;
oDoc.ComponentDefinition&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oTable &lt;BR /&gt;
As ParameterTable&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oTable = &lt;BR /&gt;
oDef.Parameters.ParameterTables(1)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
oTable.FileName = "C:\temp\test_copy.xls"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;End &lt;BR /&gt;
Sub&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Sanjay-&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 24 Feb 2009 22:14:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/change-source-of-3rd-party-spreadsheet/m-p/2435529#M148107</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-02-24T22:14:52Z</dc:date>
    </item>
    <item>
      <title>Re: Change source of 3rd party spreadsheet.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/change-source-of-3rd-party-spreadsheet/m-p/3222534#M148108</link>
      <description>&lt;P&gt;Can this be done in an Inventor 2009&amp;nbsp;.dwg also? I have a linked spreadsheet that is the parts list and I would like to change the source via a macro. I am not very good at VBA so please be gentle.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2011 17:23:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/change-source-of-3rd-party-spreadsheet/m-p/3222534#M148108</guid>
      <dc:creator>snichols</dc:creator>
      <dc:date>2011-11-09T17:23:55Z</dc:date>
    </item>
  </channel>
</rss>

