473,320 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Passing Access-VBA object to C# method

Hi there,

I have the following situation:

1. DOT.NET Application is started
2. DOT.NET Application instantiates Access.Application.8
3. Opens a specified database (MDB)
4. DOT.NET application sets a global variable in the access
application to itself (type object)
5. Runs a macro
6. In the access vba code methods of the DOT.NET application are
called (works fine), this is done within a VBA class.

Problem:
Some of the methods in the DOT.NET application display a WinForm to
the user. Depending on the things the user does, I would need to query
information from the access application. For this I would need some
kind of a callback from the DOT.NET method to the calling vba-object
that originally called the method.

To solve this problem, I thought I can pass the vba-object to the
method as a parameter.

In the DotNet is added a parameter of type "object" to the method.
In the vba-class I added Me as a parameter:

C#: public void Show(object caller, string message) {...
InvokeMethod.... // for callbacks }
VBA: dotnet.Show Me, "Hello"

I get an error message and the problem seems that I cannot pass an
"vba object" to the parameter. Many other data types work just fine,
but I cannot pass a vba object.

Do I need to define a different data type in the C#-method? Is it
possible at all?

Before, I had another architecture, where I implemented a COM-Object
which was then instantiated from VBA in Access. I had big problems,
because displaying a WinForm in the Access97 ActiveX containter is not
supported by microsoft and many things do not work correctly. But
passing an vba object to a C# method had worked with this solution.

Some experts with good ideas would help.

Thanks

Andreas
Jul 21 '05 #1
0 2014

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

Similar topics

10
by: Rigga | last post by:
Hi, Ok first please bear with me as I am a total Python n00b.. Can anyone explain why this does not like me using % FileLoc in the os.system call??? #!/usr/bin/python import sys import os
2
by: Jonathan Driller | last post by:
I am attempting to block repeat downloads from a site. I need to have a landing page pass a referer to a secured page. I have tried a meta refresh redirect and several Javascript redirect...
58
by: jr | last post by:
Sorry for this very dumb question, but I've clearly got a long way to go! Can someone please help me pass an array into a function. Here's a starting point. void TheMainFunc() { // Body of...
11
by: comp.lang.php | last post by:
On one of my sites, I have a TCL CGI script that has a security hole in spite of it having effective server-side validation (the fact that it's CGI IS its security hole). The front end is a PHP...
2
by: Morgan | last post by:
Thanks to all of you because I solved the problem related with my previous post. I simply made confusion with pointers to pointers and then succeeded passing the reference to the first element...
4
by: hello smith | last post by:
I have a lot of functions that add values to an array. They alos update a global variable of type int. Currently, I use a global variable to hold this array. All functions access this array...
3
by: Das | last post by:
Hi all, I'm writig an application that sends an http request to java servlet file. I have to pass an xml file to the servlet. How should I pass xml file to the file. When I try to access the...
8
by: S. | last post by:
Hi all, Can someone please help me with this? I have the following struct: typedef struct { char *name; int age; } Student;
1
by: Dean Slindee | last post by:
VS2008, .NetFramework 3.5 SP1: I have built a LINQ data access layer project. When the LINQ data context was built over an existing SQL2005 database, the connection string for that database was...
4
by: arnuld | last post by:
I am passing an array of struct to a function to print its value. First I am getting Segfaults and weired values. 2nd, is there any elegant way to do this ? /* Learning how to use an array...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.