
Executing Excel-VBA code within a Access-database
Once you've got your recordset, simply instantiate an Excel Application
Object using VBA in Access. This will fire up a copy of excel from within
MS Access. You can then use the Excel Object's method's and properties to
manipulate the data and the spreadsheet in any manner you see fit. You need
not ever fire up Excel except to view your results. We do this all the time
at work from other VBA enabled applications. Since everyone has Excel, it
is easy for them to open up the output of certain applications.
Quote:
> Hello,
> I'm stuck with a problem with one of the databases i'm building, so i'm
> hoping someone is able to help me...
> Within my database (Acc. 2000) i've got a query containing a great ammount
> of data (over 10.000 records). This data must be exported to a Excel file.
> Within this Excel file I want the data to be subtotalized (and change some
> fonts/colors columns widhts etc.). Now I've created the VBA macro code
which
> does the action in Excel, but what I really want is to run this Excell-VBA
> code from Access. So after I pressed the export-button in my database, and
> i'm opening the Excel file I don't have to copy and paste the VBA code.
> If anyone has any suggestions, they would be appreciated.
> Thanx,
> Remco Groot Beumer
> Holland