Advertisement

08.30.2007 at 02:37PM PDT, ID: 22798717
[x]
Attachment Details

Running macro in Access from VB Express /Transfer Excel file to Access DB from VB

Asked by Robbals in Access Coding/Macros, Microsoft Visual Studio Express

Tags: access, macro, vb, excel, file

Hi experts,

I have another problem. I need OR to run a macro in access OR to transfer an excel-file with about 13 colomns into an access database FROM VB.

The code I'm using now is:
        Dim oAccess As Microsoft.Office.Interop.Access.ApplicationClass
        oAccess = CreateObject("Access.Application")
        oAccess.Visible = True
        oAccess.OpenCurrentDatabase(dbpsi_source)
        'Run the macros.
        oAccess.Run("Import_Openfpsi")
        oAccess.DoCmd().Quit(AcQuitOption.acQuitSaveAll)
        System.Runtime.InteropServices.Marshal.ReleaseComObject(oAccess)
        oAccess = Nothing
This "should" work but always returns the error: "can't find the procedure 'Import_Openfpsi.'" (altough the MACRO excists)
The only thing this macro does is transfer an excel file to the access database....(works manually, so macro is ok)
Wouldn't it be better just to code this transfer??? If so, anyone has the code for this?? Or the answer/solution why I get this error?

Thanks for your time.

Regards,
RobStart Free Trial
[+][-]08.30.2007 at 05:42PM PDT, ID: 19805192

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Access Coding/Macros, Microsoft Visual Studio Express
Tags: access, macro, vb, excel, file
Sign Up Now!
Solution Provided By: thenelson
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_1_20070628