Adding dll-reference unsing VBA

Adding dll-reference unsing VBA

Anonymous
Not applicable
700 Views
4 Replies
Message 1 of 5

Adding dll-reference unsing VBA

Anonymous
Not applicable
Is it possible to add a DLL-reference to a VBA module in an inventor document WITHOUT opening the file, selecting "Tools" - "References" etc? I want to "modernize" my VBA code in a lot of IDW files, and need to add the same, new reference to each IDW. I can check to see if the reference is present using a check like this: For Each oRef in oDoc.VBAProject.VBProject.References if oRef.Name = "CommonMacros" then bNew = True Next oRef etc... But I can't find a way to "add" the missing one... Is it possible to use a Declare statement to do the job? Also if the "DLL" is default.ivb ?? I am stuck! Any hints or workarounds?!? /IBMo
0 Likes
701 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
Is this a fantastic stupid question since no one respond to it?
/IBMo
0 Likes
Message 3 of 5

Anonymous
Not applicable
Does this help Dim fso As Object Set fso = CreateObject("Scripting.FileSystemObject") The above will allow you to use the scrrun.dll The below would require you to set a reference to it first dim fso as FileSystemObject set fso = CreateObject("Scripting.FileSystemObject") I found this here http://sandsprite.com/CodeStuff/Understanding_plugins.html by doing a google search for "reference dll at runtime" -- Kent Keller Autodesk Discussion Forum Facilitator "noaibmo" wrote in message news:33152305.1088152424766.JavaMail.jive@jiveforum1... > Is this a fantastic stupid question since no one respond to it? > /IBMo
0 Likes
Message 4 of 5

Anonymous
Not applicable
Hi Kent! Thanks for the reply! To solve my problem using the best possible solution, I needed to add a reference to "ApplicationProject" / DEFAULT.IVB, hence my question. This I still don't know how to do. My second best solution would be to add a reference to the DAO library. Using the Google seach tip of yours I found a solution using AddFromGuid Call oDoc.VBAProject.VBProject.References.AddFromGuid("{00025E01-0000-0000-C000-0 00000000046}", 5, 0) ' Adds a reference to dao360.dll - MS Access DAO library Its not yet supported, I think because I get an error "Failed to open document." But the reference IS ADDED. So who cares... :-) Thanks again Kent! "Kent Keller" wrote in message news:40dc4b47$1_1@newsprd01... Does this help Dim fso As Object Set fso = CreateObject("Scripting.FileSystemObject") The above will allow you to use the scrrun.dll The below would require you to set a reference to it first dim fso as FileSystemObject set fso = CreateObject("Scripting.FileSystemObject") I found this here http://sandsprite.com/CodeStuff/Understanding_plugins.html by doing a google search for "reference dll at runtime" -- Kent Keller Autodesk Discussion Forum Facilitator "noaibmo" wrote in message news:33152305.1088152424766.JavaMail.jive@jiveforum1... > Is this a fantastic stupid question since no one respond to it? > /IBMo
0 Likes
Message 5 of 5

Anonymous
Not applicable
I am not sure I am following, but if you are trying to gt DOA 3.6 try this Dim oDOA As Object Set oDOA = CreateObject("DAO.DBEngine.36") -- Kent Keller Autodesk Discussion Forum Facilitator "IBMo" wrote in message news:40e00d5a_1@newsprd01... > Hi Kent! > > Thanks for the reply! > To solve my problem using the best possible solution, I needed to add a > reference to "ApplicationProject" / DEFAULT.IVB, hence my question. This I > still don't know how to do. > My second best solution would be to add a reference to the DAO library. > Using the Google seach tip of yours I found a solution using AddFromGuid > > Call > oDoc.VBAProject.VBProject.References.AddFromGuid("{00025E01-0000-0000-C000-0 > 00000000046}", 5, 0) ' Adds a reference to dao360.dll - MS Access DAO > library > > Its not yet supported, I think because I get an error "Failed to open > document." But the reference IS ADDED. So who cares... :-) > > Thanks again Kent!
0 Likes