Accessing a VBA module from VB.Net/CSharp

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Guest's Avatar

    #1

    Accessing a VBA module from VB.Net/CSharp

    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

  • Norman Yuan

    #2
    Re: Accessing a VBA module from VB.Net/CSharp

    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).

    <mike_kenyon@ti scali.co.uk> wrote in message
    news:005a01c3b4 fe$691e1d60$a10 1280a@phx.gbl.. .[color=blue]
    > 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
    >[/color]


    Comment

    • Mike

      #3
      Re: Accessing a VBA module from VB.Net/CSharp

      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

      "Norman Yuan" <normanyuan@Rem oveThis.shaw.ca > wrote in message news:<eRqxb.509 411$9l5.283459@ pd7tw2no>...[color=blue]
      > 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).
      >
      > <mike_kenyon@ti scali.co.uk> wrote in message
      > news:005a01c3b4 fe$691e1d60$a10 1280a@phx.gbl.. .[color=green]
      > > 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
      > >[/color][/color]

      Comment

      Working...