Add reference in MS-Access Problem.

kashif.special2005

Active Member
Joined
Oct 26, 2009
Messages
443
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
Hi,
<o:p> </o:p>
I have created a MS-Access based tool and I am adding below mentioned references at a form load event, it is working fine at my workstation but when I am running this tool in other system it is not working properly because like at my system calendar control version 10 and on that system have version 8, Excel object library 12 and on that system have version 11.
<o:p> </o:p>
I want that whenever I open the form it will automatically add most latest version in reference. Of below mentioned references.
<o:p> </o:p>
<TABLE style="MARGIN: auto auto auto 5.4pt; WIDTH: 88.8pt; BORDER-COLLAPSE: collapse; mso-padding-alt: 0in 5.4pt 0in 5.4pt" class=MsoNormalTable border=0 cellSpacing=0 cellPadding=0 width=118><TBODY><TR style="HEIGHT: 12.75pt; mso-yfti-irow: 0; mso-yfti-firstrow: yes"><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; BACKGROUND-COLOR: transparent; PADDING-LEFT: 5.4pt; WIDTH: 88.8pt; PADDING-RIGHT: 5.4pt; HEIGHT: 12.75pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=118 noWrap>VBA
</TD></TR><TR style="HEIGHT: 12.75pt; mso-yfti-irow: 1"><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; BACKGROUND-COLOR: transparent; PADDING-LEFT: 5.4pt; WIDTH: 88.8pt; PADDING-RIGHT: 5.4pt; HEIGHT: 12.75pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=118 noWrap>Access
</TD></TR><TR style="HEIGHT: 12.75pt; mso-yfti-irow: 2"><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; BACKGROUND-COLOR: transparent; PADDING-LEFT: 5.4pt; WIDTH: 88.8pt; PADDING-RIGHT: 5.4pt; HEIGHT: 12.75pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=118 noWrap>stdole
</TD></TR><TR style="HEIGHT: 12.75pt; mso-yfti-irow: 3"><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; BACKGROUND-COLOR: transparent; PADDING-LEFT: 5.4pt; WIDTH: 88.8pt; PADDING-RIGHT: 5.4pt; HEIGHT: 12.75pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=118 noWrap>ADODB
</TD></TR><TR style="HEIGHT: 12.75pt; mso-yfti-irow: 4"><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; BACKGROUND-COLOR: transparent; PADDING-LEFT: 5.4pt; WIDTH: 88.8pt; PADDING-RIGHT: 5.4pt; HEIGHT: 12.75pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=118 noWrap>OWC10
</TD></TR><TR style="HEIGHT: 12.75pt; mso-yfti-irow: 5"><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; BACKGROUND-COLOR: transparent; PADDING-LEFT: 5.4pt; WIDTH: 88.8pt; PADDING-RIGHT: 5.4pt; HEIGHT: 12.75pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=118 noWrap>Excel
</TD></TR><TR style="HEIGHT: 12.75pt; mso-yfti-irow: 6"><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; BACKGROUND-COLOR: transparent; PADDING-LEFT: 5.4pt; WIDTH: 88.8pt; PADDING-RIGHT: 5.4pt; HEIGHT: 12.75pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=118 noWrap>DAO
</TD></TR><TR style="HEIGHT: 12.75pt; mso-yfti-irow: 7"><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; BACKGROUND-COLOR: transparent; PADDING-LEFT: 5.4pt; WIDTH: 88.8pt; PADDING-RIGHT: 5.4pt; HEIGHT: 12.75pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=118 noWrap>Office
</TD></TR><TR style="HEIGHT: 12.75pt; mso-yfti-irow: 8"><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; BACKGROUND-COLOR: transparent; PADDING-LEFT: 5.4pt; WIDTH: 88.8pt; PADDING-RIGHT: 5.4pt; HEIGHT: 12.75pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=118 noWrap>MSOWCFLib
</TD></TR><TR style="HEIGHT: 12.75pt; mso-yfti-irow: 9; mso-yfti-lastrow: yes"><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; BACKGROUND-COLOR: transparent; PADDING-LEFT: 5.4pt; WIDTH: 88.8pt; PADDING-RIGHT: 5.4pt; HEIGHT: 12.75pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8; PADDING-TOP: 0in" vAlign=bottom width=118 noWrap>MSACAL
</TD></TR></TBODY></TABLE>
<o:p> </o:p>
Sub AddRefs()<o:p></o:p>
Dim loRef As Access.Reference<o:p></o:p>
Dim guid1 As String<o:p></o:p>
Dim guid2 As String<o:p></o:p>
Dim guid3 As String<o:p></o:p>
Dim guid4 As String<o:p></o:p>
Dim guid5 As String<o:p></o:p>
Dim guid6 As String<o:p></o:p>
Dim guid7 As String<o:p></o:p>
Dim guid8 As String<o:p></o:p>
Dim guid9 As String<o:p></o:p>
Dim guid10 As String<o:p></o:p>
<o:p> </o:p>
guid1 = "{000204EF-0000-0000-C000-000000000046}"<o:p></o:p>
guid2 = "{4AFFC9A0-5F99-101B-AF4E-00AA003F0F07}"<o:p></o:p>
guid3 = "{00020430-0000-0000-C000-000000000046}"<o:p></o:p>
guid4 = "{00000205-0000-0010-8000-00AA006D2EA4}"<o:p></o:p>
guid5 = "{0002E550-0000-0000-C000-000000000046}"<o:p></o:p>
guid6 = "{00020813-0000-0000-C000-000000000046}"<o:p></o:p>
guid7 = "{00025E01-0000-0000-C000-000000000046}"<o:p></o:p>
guid8 = "{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}"<o:p></o:p>
guid9 = "{5D0A2606-5783-11D1-B901-00AA00585640}"<o:p></o:p>
guid10 = "{8E27C92E-1264-101C-8A2F-040224009C02}"<o:p></o:p>
<o:p> </o:p>
On Error Resume Next<o:p></o:p>
<o:p> </o:p>
With Access.References<o:p></o:p>
.AddFromGuid guid1, 1, 0<o:p></o:p>
.AddFromGuid guid2, 1, 0<o:p></o:p>
.AddFromGuid guid3, 1, 0<o:p></o:p>
.AddFromGuid guid4, 1, 0<o:p></o:p>
.AddFromGuid guid5, 1, 0<o:p></o:p>
.AddFromGuid guid6, 1, 0<o:p></o:p>
.AddFromGuid guid7, 1, 0<o:p></o:p>
.AddFromGuid guid8, 1, 0<o:p></o:p>
.AddFromGuid guid9, 1, 0<o:p></o:p>
.AddFromGuid guid10, 1, 0<o:p></o:p>
<o:p> </o:p>
End With<o:p></o:p>
<o:p> </o:p>
' Call a hidden SysCmd to automatically compile/save all modules.<o:p></o:p>
Call SysCmd(504, 16483)<o:p></o:p>
End Sub

Please help
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
The references will be the same if you are using the same file. Are you using different front end copies with similar user views?
 
Upvote 0

Forum statistics

Threads
1,215,361
Messages
6,124,497
Members
449,166
Latest member
hokjock

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top