473,782 Members | 2,554 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 3778
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
20893
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
6063
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
9639
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
9474
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10308
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10076
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
6729
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
5507
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4040
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
2
3633
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2870
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.