<?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 How do you programmatically load references? in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/how-do-you-programmatically-load-references/m-p/2652122#M13883</link>
    <description>I have several large VBA programs that I've written in the AutoCAD VBA IDE. These programs retrieve data from Excel files. Most of the time, the programs work fine. However, occasionally, I need to send the program to a new user that uses a different version of Excel. Of course, the program doesn't work in these cases, because the Excel reference is wrong, and it is sometimes difficult to explain to the user how to go into the VBA interface and change the reference.&lt;BR /&gt;
I need to find a way to programmatically set the Excel library reference. Ideally, this code would search the users computer for the version of excel, and then load the correct VBA reference.&lt;BR /&gt;
&lt;BR /&gt;
I've done some research, and found different methods for loading the references between other Microsoft programs, but not between Acad and Excel.&lt;BR /&gt;
&lt;BR /&gt;
I'm hoping someone here can provide some direction.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Thanks</description>
    <pubDate>Sun, 21 Mar 2010 16:33:18 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2010-03-21T16:33:18Z</dc:date>
    <item>
      <title>How do you programmatically load references?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/how-do-you-programmatically-load-references/m-p/2652122#M13883</link>
      <description>I have several large VBA programs that I've written in the AutoCAD VBA IDE. These programs retrieve data from Excel files. Most of the time, the programs work fine. However, occasionally, I need to send the program to a new user that uses a different version of Excel. Of course, the program doesn't work in these cases, because the Excel reference is wrong, and it is sometimes difficult to explain to the user how to go into the VBA interface and change the reference.&lt;BR /&gt;
I need to find a way to programmatically set the Excel library reference. Ideally, this code would search the users computer for the version of excel, and then load the correct VBA reference.&lt;BR /&gt;
&lt;BR /&gt;
I've done some research, and found different methods for loading the references between other Microsoft programs, but not between Acad and Excel.&lt;BR /&gt;
&lt;BR /&gt;
I'm hoping someone here can provide some direction.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Thanks</description>
      <pubDate>Sun, 21 Mar 2010 16:33:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/how-do-you-programmatically-load-references/m-p/2652122#M13883</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-03-21T16:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: How do you programmatically load references?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/how-do-you-programmatically-load-references/m-p/2652123#M13884</link>
      <description>i have the same problem like yours, untill i use Access library, all de code run smoothly,and Excel can change to Access as well</description>
      <pubDate>Mon, 22 Mar 2010 09:32:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/how-do-you-programmatically-load-references/m-p/2652123#M13884</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-03-22T09:32:01Z</dc:date>
    </item>
    <item>
      <title>Re: How do you programmatically load references?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/how-do-you-programmatically-load-references/m-p/2652124#M13885</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
Here are a couple of methods taken from Randal Rath's newsletter of 2 &lt;BR /&gt;
Nov 2000&lt;BR /&gt;
&lt;BR /&gt;
Question&lt;BR /&gt;
&lt;BR /&gt;
What in your opinion is the best way to check to see if a file exists in a folder&lt;BR /&gt;
&lt;BR /&gt;
The Common Answer:&lt;BR /&gt;
{code}&lt;BR /&gt;
Private Function DoesFileExist(strFnamePath As String) As Boolean&lt;BR /&gt;
    strFnamePath = Dir(strFnamePath)&lt;BR /&gt;
    If strFnamePath = "" Then&lt;BR /&gt;
        DoesFileExist = False&lt;BR /&gt;
    Else&lt;BR /&gt;
        DoesFileExist = True&lt;BR /&gt;
    End If&lt;BR /&gt;
End Function&lt;BR /&gt;
{code}&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
The Secret Answer:&lt;BR /&gt;
&lt;BR /&gt;
{code}&lt;BR /&gt;
Declare Function PathFileExists Lib "shlwapi" Alias _&lt;BR /&gt;
"PathFileExistsA" (ByVal strFile As String) As Long&lt;BR /&gt;
&lt;BR /&gt;
Public Function FileExists(spFileSpec As String) As Boolean&lt;BR /&gt;
  FileExists = PathFileExists(spFileSpec)&lt;BR /&gt;
End Function ' FileExists&lt;BR /&gt;
{code}&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Is it better? You bet! It handles any path (UNC or Local) and is about 200% faster!&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Laurie Comerford&lt;BR /&gt;
&lt;BR /&gt;
bmincemoyer@verizon.net wrote:&lt;BR /&gt;
&amp;gt; I have several large VBA programs that I've written in the AutoCAD VBA IDE. These programs retrieve data from Excel files. Most of the time, the programs work fine. However, occasionally, I need to send the program to a new user that uses a different version of Excel. Of course, the program doesn't work in these cases, because the Excel reference is wrong, and it is sometimes difficult to explain to the user how to go into the VBA interface and change the reference.&lt;BR /&gt;
&amp;gt; I need to find a way to programmatically set the Excel library reference. Ideally, this code would search the users computer for the version of excel, and then load the correct VBA reference.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; I've done some research, and found different methods for loading the references between other Microsoft programs, but not between Acad and Excel.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; I'm hoping someone here can provide some direction.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Thanks&lt;BR /&gt;
&amp;gt;</description>
      <pubDate>Mon, 22 Mar 2010 09:39:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/how-do-you-programmatically-load-references/m-p/2652124#M13885</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-03-22T09:39:47Z</dc:date>
    </item>
  </channel>
</rss>

