Accessing a VBA module from VB.Net/CSharp

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

This does sound like a bit of a weird thing to ask so I
will state my question and then further down explain why
I am trying to do it. So if you have the answer then
reply! Or if you understand what I am trying to do and
can suggest a better solution then reply also!

Question
--------
I want to run a VBA code module from either
VB/VB.NET/C#. How can I go about calling the call module?

Why
---

I have an MS Access project that is hooked up with SQL-
MSDE. I have developed a complex and nice looking
report. What I want to do is let my work colleges view
it over the internal intranet. The Data Access Pages
doesn't seem to work - Access throws a fit over the
calulated fields. In Access though you can use the
ExportXML feature and it creates the XML files that can
be viewed in any web browser. So I have written a code
module that does this in the Access project. I then want
to run this and the XMl files will get updated. Simple
request I thought..

Any help, as always, greatly appreciated.

cheers
Mike
 
You can only run VBA code inside that Application, MS Access in your case.
You can have your .NET App start your Access project though COM automation
and use DoCmd.RunMacro to execute the VBA code you want to run. Also, user
of your app is also required to have MS Access installed. So, the question
could be, now that MS Access is installed, why not have everyone run the MS
Access project for the reports directly? (That is what I did in our small
network- 20 computers/users. I created our main business desktop apps in
..NET with MSDE backend and put all data reporting fuctionality in a MS
Access project, just because of MS Access is avialable on everyone's
computer and MS Access' reporting functionalities are very good, when
working with SQL Server/MSDE (much better than Crystal Report.NET, IMO).
 
Norman,

Thanks for that. I can see what you are saying, I think I will have to
go with Access/SQL project. I haven't expierence of Crystal
Reports.NET so I won't comment!

Cheers
mike
 
Back
Top