Excel 365 - VB script - Template File Getting Too Large

santa12345

Board Regular
Joined
Dec 2, 2020
Messages
66
Office Version
  1. 365
Platform
  1. Windows
Hello.

I currently have a working vb script in access.


1. Takes a template.. abc.xls
2. opens up the template
3. exports customer data into particular tabs within the template
4. saves and renames the template according to the customer name
5. script then picks the next customer and repeats steps 2 - 4

The question / issue is... the template starts out around 10 mb. As it goes thru the process, the file size grows to almost 40 mb, causing the process to really slow down, etc...
If I take the template, open it up and just save it and check the file size it quickly goes down in size.

What can I do after the template is populated and saved with the customer name within the script, that will take the template and reduce the size before the next customer output is exported to the template?

Any ideas / suggestions would be greatly appreciated.
Thank you.
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Forum statistics

Threads
1,216,119
Messages
6,128,941
Members
449,480
Latest member
yesitisasport

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top