G
Guest
I have this code in access which transfers 4 tables into an excel
spreadsheet. I have a macro in excel that does the formatting.
Is there a way to trigger the excel formatting macro from the access code,
instead of me manually having to open the spreadsheet and using the menu to
run the macro?
Heres the access code:
Private Sub cmdAssocGenerator_Click()
Dim FullFileName, Table1, Table2, Table3, Table4 As String
Table1 = "dbo_Assoc10-Demographics&Volume&CB"
Table2 = "dbo_Assoc10-Equipment"
Table3 = "dbo_Assoc10-InvoiceMast"
Table4 = "dbo_Assoc10-InvoiceMast QA"
FullFileName = "n:\DWarehouse\Dal\" & txtFileName.Value & ".xls"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, Table1,
FullFileName, Yes
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, Table2,
FullFileName, Yes
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, Table3,
FullFileName, Yes
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, Table4,
FullFileName, Yes
MsgBox "DONE!", vbOKOnly, "Exporting Finished"
End Sub
And here is the name of my excel macro:
personal.xls!Can_format
spreadsheet. I have a macro in excel that does the formatting.
Is there a way to trigger the excel formatting macro from the access code,
instead of me manually having to open the spreadsheet and using the menu to
run the macro?
Heres the access code:
Private Sub cmdAssocGenerator_Click()
Dim FullFileName, Table1, Table2, Table3, Table4 As String
Table1 = "dbo_Assoc10-Demographics&Volume&CB"
Table2 = "dbo_Assoc10-Equipment"
Table3 = "dbo_Assoc10-InvoiceMast"
Table4 = "dbo_Assoc10-InvoiceMast QA"
FullFileName = "n:\DWarehouse\Dal\" & txtFileName.Value & ".xls"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, Table1,
FullFileName, Yes
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, Table2,
FullFileName, Yes
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, Table3,
FullFileName, Yes
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, Table4,
FullFileName, Yes
MsgBox "DONE!", vbOKOnly, "Exporting Finished"
End Sub
And here is the name of my excel macro:
personal.xls!Can_format