ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   macro to select reference in tools--references (https://www.excelbanter.com/excel-programming/432246-macro-select-reference-tools-references.html)

Sam

macro to select reference in tools--references
 
Can I write a macro to select a particular reference in
"Tools---References---...." I have a system where excel userform and access
database is used, and not all users have access on their machines.
To make this system work I have to select "Tools--References--Microsoft
Access 12.0 Object Library" and as access is installed in all machines, Users
get "Missing" in front of access reference and hence cannot use the userform.
NOTE: access is not involved in the system until later. There are 3 steps in
this sysetm: 1--2--3
1: users input their data into userform and click submit
2: once users click submit I get an email as an excel attachment with their
data
3: In that email attachment I have an "Accept" button, Once I hit accept
then it populates in access.

Please Help

Thanks in advance.

Dave Peterson

macro to select reference in tools--references
 
Another option is to use late binding and eschew the reference to Access
completely.

You'll be able to check to see if Access is installed and process accordingly.

Some references:

http://support.microsoft.com/default...b;EN-US;244167
INFO: Writing Automation Clients for Multiple Office Versions

http://support.microsoft.com/default...b;en-us;245115
INFO: Using Early Binding and Late Binding in Automation

http://support.microsoft.com/default...b;en-us;247579
INFO: Use DISPID Binding to Automate Office Applications Whenever Possible

and Dick Kusleika has a web page at:
http://www.dicks-clicks.com/excel/olBinding.htm
that explains this with Outlook

==========
I'd develop with the references so that I could get the benefit of the
intellisense and autocomplete within the VBE, but then change to late binding
before sharing with others.



sam wrote:

Can I write a macro to select a particular reference in
"Tools---References---...." I have a system where excel userform and access
database is used, and not all users have access on their machines.
To make this system work I have to select "Tools--References--Microsoft
Access 12.0 Object Library" and as access is installed in all machines, Users
get "Missing" in front of access reference and hence cannot use the userform.
NOTE: access is not involved in the system until later. There are 3 steps in
this sysetm: 1--2--3
1: users input their data into userform and click submit
2: once users click submit I get an email as an excel attachment with their
data
3: In that email attachment I have an "Accept" button, Once I hit accept
then it populates in access.

Please Help

Thanks in advance.


--

Dave Peterson

smartin

macro to select reference in tools--references
 
sam wrote:
Can I write a macro to select a particular reference in
"Tools---References---...." I have a system where excel userform and access
database is used, and not all users have access on their machines.
To make this system work I have to select "Tools--References--Microsoft
Access 12.0 Object Library" and as access is installed in all machines, Users
get "Missing" in front of access reference and hence cannot use the userform.
NOTE: access is not involved in the system until later. There are 3 steps in
this sysetm: 1--2--3
1: users input their data into userform and click submit
2: once users click submit I get an email as an excel attachment with their
data
3: In that email attachment I have an "Accept" button, Once I hit accept
then it populates in access.

Please Help

Thanks in advance.


This is not a specific answer, but I think you would benefit from
studying the concepts of early- and late-binding, and how to code an
application that requires late binding.

Googling this:
vba early late binding how to detect reference
places excellent reading material at the top.

Hope this helps!


All times are GMT +1. The time now is 07:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com