santa12345
Board Regular
- Joined
- Dec 2, 2020
- Messages
- 70
- Office Version
- 365
- Platform
- Windows
Hello.
I currently have some vb code in Access that is working.
The code looks at a table in access. Lets say it has 400 line items of information.
The script will take the first record, run a few queries, export each table to an excel file (template). Let's say the template is called test.xls
So the queries are ran, tables are exported into various tabs within test.xls and using the following command, it saves the files with some variables. (date/region,etc...)
RetVal = Shell("cmd /c copy /y c:\123\test.xls c:\123\US\" & datename & "\" & strDistrict & "\" & strWI & txt_agree & "\" & strWI & txt_agree & strxcel, vbHide)
The process keeps looping thru the 400 line item table, and repeats. Everything is working, the only issue I have is the template grows in size after repeating this process.
If i simply open up the template, save it, close it, the file size decreases considerable.
I was wondering if there was a Retval command or some other line item command - that I can add after the above command.....that will open the template (if needed), save and close it.
Any input would be greatly appreciated.
I currently have some vb code in Access that is working.
The code looks at a table in access. Lets say it has 400 line items of information.
The script will take the first record, run a few queries, export each table to an excel file (template). Let's say the template is called test.xls
So the queries are ran, tables are exported into various tabs within test.xls and using the following command, it saves the files with some variables. (date/region,etc...)
RetVal = Shell("cmd /c copy /y c:\123\test.xls c:\123\US\" & datename & "\" & strDistrict & "\" & strWI & txt_agree & "\" & strWI & txt_agree & strxcel, vbHide)
The process keeps looping thru the 400 line item table, and repeats. Everything is working, the only issue I have is the template grows in size after repeating this process.
If i simply open up the template, save it, close it, the file size decreases considerable.
I was wondering if there was a Retval command or some other line item command - that I can add after the above command.....that will open the template (if needed), save and close it.
Any input would be greatly appreciated.