Vba excel file size increases




















Then call this sub at the end of every other sub in the workbook? Forget that KillVar sub; it doesn't matter. End With instead. Re: File size change after running macro Check if you have variables that are not destroyed after the sub-routine.

Re: File size change after running macro Thanks for the reply. Re: File size change after running macro. Re: File size change after running macro The size of your file is highly dependent on the usedranges in the sheets especially when formatted.

Re: File size change after running macro Forget that KillVar sub; it doesn't matter. User Menu Login Registration. Your browser has JavaScript disabled. If you would like to use all features of this site, it is mandatory to enable JavaScript. But are more related to an increase in file size after writing lots of macros. Or a corrupt workbook. Then delete all Modules and Forms in your Workbook. Now Import all Forms and Modules from your hard drive back in.

Right Click on any sheet name tab and select "Move or Copy". The problem I'm facing is that every time I save the file after running the macro, the file size increases by roughly 14MB.

My theory is that some part of the pivot isn't being deleted but I can't seem to put my finger on what. I have found the solution to my problem. When I create the pivot tables I also add connections, since I need to display the number of unique entries in the pivot table:.

Where inputDataArea is a String with the range used by for the pivot table. My problem was, that I was not deleting these connections when I was deleting the pivot table. So a new connection was being added every time the macro was executed.

I added this piece of code to also remove any connections that are no longer needed after removing the pivot table:.

How are we doing? Please help us improve Stack Overflow. Take our short survey. Stack Overflow for Teams — Collaborate and share knowledge with a private group.

Create a free Team What is Teams? Need more help? Expand your skills. Get new features first. Was this information helpful? Yes No. Thank you! Any more feedback? The more you tell us the more we can help. Can you help us improve? Resolved my issue. Clear instructions.

Easy to follow. No jargon. Pictures helped.



0コメント

  • 1000 / 1000