I have posted this question in excel as well: follow the link please
<A target="_blank" HREF=http://www.wopr.com/cgi-bin/w3t/showflat.pl?Cat=&Board=xl&Number=104770&page=0&vie w=collapsed&sb=5&o=0&fpart=&vc=>http://www.wopr.com/cgi-bin/w3t/showflat.p...;fpart=&vc=</A>

Hi all i have an event procedure code in an acess form that exports a query to an excel file, i then have the code that opens the excel file that was just ouputed to for the viewer. I have a macro in that excel workbook that i would like executed everytime it is opened(ie after the export)

the code in access is:

Private Sub cmdExp_Click()

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel97, "Find All Issues by Selected Criteria2", "C:WINNTProfilesEdward SantevecchiDesktopFind All Issues By Selected Criteria2.xls"

Dim appExcel As Excel.Application

Set appExcel = CreateObject("Excel.Application")

appExcel.Visible = True

appExcel.Workbooks.Open "C:WINNTProfilesEdward SantevecchiDesktopFind All Issues By Selected Criteria2.xls"

/////Code that runs excel macro here would be great!!!!!!!!!!////////////////////////////////

End Sub

If i could auto start the macro from within excel that would work or if there were code i could use in access to execute an excel macro that would do the same, i think the coding would be more difficult though. ANy suggesstions?


Edited by Charlotte to activate link