473,769 Members | 1,632 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Application.Run with custom add-ins

I have a custom add-in which is installed via the Add-In Manager and works
fine when called manually from the Add-Ins menu. The goal is to be able to
run the entry function of the add-in from code in the current database.
Normally, all that is needed to do it is to use

Application.Run "[addin project name].[entry function name]"

This indeed works in the A97 version of the same add-in. However, when I do
this in A2002 or A2003, Access crashes. The only time when Access does not
crash in this scenario is when before running the above statement, I
manually run the add-in from the menu. In this case, it will work as long
as Access remains open. So it looks as if Access needs to load and
"recognize" the add-in's VBA project before I can call a function in that
project from code. It does work if I explicitly add a reference to the add-
in, but I can't use that solution for unrelated reasons.

The entry function in the add-in is very simple:

Public Function dbp_Entry() As Boolean

DoCmd.OpenForm "frm"

End Function

where frm is a form in the add-in.

Any ideas, experiences, and workarounds would be appreciated.

--
remove a 9 to reply by email
Nov 12 '05 #1
2 3777
On Sun, 02 May 2004 00:27:03 -0000, Dimitri Furman
<df*****@cloud9 9.net> wrote:

Maybe I'm way off base here, but couldn't you use CreateObject (and
thus late binding) if you don't like early binding?
Pseudo-code:
dim x as object
dim b as boolean
set x = createobject("m yaddin")
b = x.dbp_Entry()

-Tom.

I have a custom add-in which is installed via the Add-In Manager and works
fine when called manually from the Add-Ins menu. The goal is to be able to
run the entry function of the add-in from code in the current database.
Normally, all that is needed to do it is to use

Application.Ru n "[addin project name].[entry function name]"

This indeed works in the A97 version of the same add-in. However, when I do
this in A2002 or A2003, Access crashes. The only time when Access does not
crash in this scenario is when before running the above statement, I
manually run the add-in from the menu. In this case, it will work as long
as Access remains open. So it looks as if Access needs to load and
"recognize" the add-in's VBA project before I can call a function in that
project from code. It does work if I explicitly add a reference to the add-
in, but I can't use that solution for unrelated reasons.

The entry function in the add-in is very simple:

Public Function dbp_Entry() As Boolean

DoCmd.OpenFo rm "frm"

End Function

where frm is a form in the add-in.

Any ideas, experiences, and workarounds would be appreciated.


Nov 12 '05 #2
On May 01 2004, 08:27 pm, Dimitri Furman <df*****@cloud9 9.net> wrote in
news:Xn******** *************** *****@127.0.0.1 :
I have a custom add-in which is installed via the Add-In Manager and
works fine when called manually from the Add-Ins menu. The goal is to
be able to run the entry function of the add-in from code in the
current database. Normally, all that is needed to do it is to use

Application.Run "[addin project name].[entry function name]"

This indeed works in the A97 version of the same add-in. However, when
I do this in A2002 or A2003, Access crashes.


It always helps to reexamine things on a Sunday morning.

I have both A97 and A2002 installed on the same machine in different
directories. Turns out that the crash was caused by A2002 trying to load
the A97 version of the add-in from the Office 97 directory. Both versions
of the MDA file were named the same, so the trivial workaround was to make
add-in names version-specific.

Whether or not the add-in was previously installed using the Add-In Manager
has no relevance on being able to run the code from the add-in using
Application.Run , although it does work if the add-in was run at least once
from the menu in the current Access session. Otherwise you get error 2517,
"Microsoft Access can't find the procedure ...". To make it work
regardless, you need to copy the add-in into Access directory, which
AFAIK is the suggested way to do it since Access 2.0...

--
remove a 9 to reply by email
Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
9835
by: Sushil Srivastava | last post by:
Hi Guys, Would you be able to help me using C# GUI (with user interface component) in my MFC application. I have used managed extension, COM-interops, etc but problem is this C# component has user interface. how should have get window handle from managed windows? Thanks in advance. Sushil
2
1840
by: mark | last post by:
Can't figure this one out. I appears to not be code related. After surfing my asp.net web app for a while 5 - 10 min. it fails to open any further connections to my access 2000 database. There seems to be no set drop off point either that would point to a specific code problem. I went through and made sure that I explicitly closed all my connections when done and even called the dispose method after each one. I noticed that asp.net...
4
5392
by: tommy | last post by:
hello everbody, i write a little asp-application with forms-authentication. i copy my aspx-files with web.config to my webspace and i get the error above... i tried to set the custom-errors-tag ="off" but nothing happens.... what is my failure????
3
375
by: Sean | last post by:
HI There, I am having trouble deploying my .aspx pages to a remote server, I have made changes to the config file and it still returns an error. I have also contacted the server administrator to create an application in IIS, what other checks can I make? Sean !-- error mesage
4
1779
by: Umut Tezduyar | last post by:
I want to use my custom control (.cs) in my web application. Custom control is in the same assembly as my application. I want to know the name of the assembly (.dll) file so i can add it's <@Pegister Assembly="abc.dll"> name. But in asp.net 2.0 i can't find the assembly. It is not compiled under the /bin folder. Where it is, or how can i give a reference to it?
4
20890
by: Joe | last post by:
I created a CustomAction for this but I don't think I have it in the right place. I tried both Install and Commit but neither allow it to get to the final screen. Are there any examples of this anywhere? Thanks, Joe
4
1213
by: Andrew Hayes | last post by:
All, Using VS 2005, C#.NET, SQL Server 2005, W2K3. We are developing a web application that would be shared by numerous customers for information management. Some of those customers want variations on the usual form layout. For example, we have a form where the user can enter their dependents information (parents, siblings, spouse, kids, etc.), but we know one of our
6
3412
by: JeffDotNet | last post by:
Writing to a registered source in the Application event log I have an asp.net framework 2.0 app that I created on a winxp machine and now I am deploying it to IIS6 on a win server2003 machine. This application has to write to the application event log. After deployment of the application I have verified that my source “MySource” exists in the Application event log. I then wrote some text to the event source in a forms app and...
7
6148
by: Steven Cliff | last post by:
I have started to use the new Enterprise Library (Jan 06) and have set up a skeleton project using the DAAB. This all seems to work fine apart from when I come to secure the app.config file via encryption. I have encrypted the connectionsettings block in the config file but obviously when I come to deploy the solution to other PC's, it cannot read the block as it doesn't have the keys to decrypt. I understand that as far as ASP.NET...
12
6061
by: Martyn Fewtrell | last post by:
Hi there I'm trying to find the correct way to write exceptions to the Application log using Vb.Net. I've done a fair bit of Googleing and although this gets plenty of mentions and that this is apparently the correct way forward nobody offers a solution as to how it is actually done. I gather that code like:
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
10045
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9994
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8870
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7408
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6673
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5298
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3958
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.