Hello
I was wondering if you could help me. I am currently working on a process of uploading files in a certain format. The process currently entails 3 steps, please see:
-- Clicking on a .bat file Rename current files (records2.xls to records2.bak, records3.xls to records3.bak......)
-- MS Access is then launched
-- Macro is run doing the following:
-- deleting records table
-- importing records from Details.xls
-- Query records.. should now be repopulated based on the query information of each records.. using static data from tables
-- Save records2 table/query to C:\Data\records2.xls
-- Save records3 table/query to C:\Data\records3.xls
-- Save records4 table/query to C:\Data\records4.xls
-- Launch Excel - Run Macro to convert each individual file in records2.prn, records3.prn etc with a FileFormat:= _
xlTextPrinter
As the files cannot be directly saved as .prn from Access the requirement is to then use another macro in Excel.
I am trying to look at a way of incorporating the 3 steps into Excel.
Please see the VBA code from access:
Is there anyway of doing this?
Thanking you!
I was wondering if you could help me. I am currently working on a process of uploading files in a certain format. The process currently entails 3 steps, please see:
-- Clicking on a .bat file Rename current files (records2.xls to records2.bak, records3.xls to records3.bak......)
-- MS Access is then launched
-- Macro is run doing the following:
-- deleting records table
-- importing records from Details.xls
-- Query records.. should now be repopulated based on the query information of each records.. using static data from tables
-- Save records2 table/query to C:\Data\records2.xls
-- Save records3 table/query to C:\Data\records3.xls
-- Save records4 table/query to C:\Data\records4.xls
-- Launch Excel - Run Macro to convert each individual file in records2.prn, records3.prn etc with a FileFormat:= _
xlTextPrinter
As the files cannot be directly saved as .prn from Access the requirement is to then use another macro in Excel.
I am trying to look at a way of incorporating the 3 steps into Excel.
Please see the VBA code from access:
Code:
Function Create_records()
On Error GoTo Create_records_Err
DoCmd.DeleteObject acTable, "records"
' Import Details.xls
DoCmd.TransferSpreadsheet acImport, 8, "records", "C:\Data\Details.xls", True, ""
DoCmd.TransferSpreadsheet acExport, 8, "records2", "C:\Data\records2.xls", False, ""
DoCmd.TransferSpreadsheet acExport, 8, "records3", "C:\Data\records3.xls", True, ""
DoCmd.TransferSpreadsheet acExport, 8, "records4", "C:\Data\records4.xls", False, ""
Beep
End Function
Is there anyway of doing this?
Thanking you!