|
-
Mar 22nd, 2008, 11:32 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] Excel Workbook Bloat - cloning
I'm hoping someone has a reasonably robust workbook clone macro they are willing to share. Maybe clone isn't the right word to use since I don't want an exact copy - everything minus the bloat!
I've had recent cases of annoying workbook bloat - the worst offender was a 1MB workbook that suddenly become 10MB for no apparent reason. I never could figure out what the problem was. My workbooks aren't too complex - 6 to 10 worksheets, each of which has maybe 30 columns and 100 rows, 10% to 30% blank cells, 3-4 buttons for initiating macros, 4-6 charts, 10-12 array formulas.
I'm now toying with the idea of creating a workbook clone macro. I hesitate to do simple copy/paste for fear that whatever was wrong with the original will be copied to the new. I made a crude prototype that captures 15 formatting attributes plus formula of all non-blank cells in the used range of the source workbook and re-creates in a new workbook. The 10MB workbook was copied and resulted in a 0.5MB workbook (including array formulas and cell formatting like font, borders, colors, etc.), minus the charts, buttons, and macros. Apparent success.
Before I attempt the task of re-creating the charts, I thought I'd ask if anyone has already done this. Surely I'm re-inventing the wheel!
Also, is this entire idea a really stupid thing to do?
Last edited by VBAhack; Mar 22nd, 2008 at 11:56 AM.
-
Mar 22nd, 2008, 04:50 PM
#2
Re: Excel Workbook Bloat - cloning
You may tried this to see if any help instead of doing a painful job:
http://www.vbaexpress.com/kb/getarticle.php?kb_id=83
-
Mar 23rd, 2008, 04:25 AM
#3
Re: Excel Workbook Bloat - cloning
Also there is one more way to achieve it or at least finding where excatly is the problem...
If your workbook has 10 worksheets then make 10 copies of the workbook. From each workbook delete a sheet and save it. for example from copy 1 delete sheet1, copy 2 delete sheet 2 and so on...
Check after saving, which copy has the least size... that is the clue. Maybe that particular sheet has
1) unwanted data validation
2) shapes
3) colored cells
4) uwanted formulas etc...
Let's say it is sheet3 and in that sheet, your data range is A1:M1500
Do this
Highlight Column O. Then Press Shift + End and then click on right arrow key. Entire column from O to IV will be selected. Delete them.
Repeat the same excercise with Row 1501 till End
Now save the workbook.
Check the size. Has it reduced?
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Mar 24th, 2008, 11:11 PM
#4
Thread Starter
Fanatic Member
Re: Excel Workbook Bloat - cloning
Guys,
Thanks for the suggestions. I'd already tried the 1st one before with no affect. But, this time I crawled through each sheet and removed all unwanted charts and graphics. The major culprit turned out to be a couple of graphics I'd pasted on one of the sheets. The odd thing is that when I deleted the sheet with the offending graphics, the size didn't change much. It must be that a couple of the charts I also deleted were somehow adding a lot to the size as well. Anyway, I was able to reduce it back to a respectable 1.8MB (from 9.4 MB), though it still seems like it should be smaller. Still, major success, thanks. 
I do wonder, though, whether repeated saves on the same spreadsheet will continue its growth.......
Last edited by VBAhack; Mar 24th, 2008 at 11:16 PM.
-
Mar 25th, 2008, 03:50 AM
#5
Re: Excel Workbook Bloat - cloning
 Originally Posted by VBAhack
Guys,
Thanks for the suggestions. I'd already tried the 1st one before with no affect. But, this time I crawled through each sheet and removed all unwanted charts and graphics. The major culprit turned out to be a couple of graphics I'd pasted on one of the sheets. The odd thing is that when I deleted the sheet with the offending graphics, the size didn't change much. It must be that a couple of the charts I also deleted were somehow adding a lot to the size as well. Anyway, I was able to reduce it back to a respectable 1.8MB (from 9.4 MB), though it still seems like it should be smaller. Still, major success, thanks.
I do wonder, though, whether repeated saves on the same spreadsheet will continue its growth.......
If you would have deleted the sheet which had all the annoying graphics, you would have noticed the change.
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|