0

I copy-pasted content from webpages into an Excel file in various sheets.

Saving the file took a long time and I realised that the file size had grown to 6mb.

When I open the file Excel crashes.

Is there any way to remove all objects through VBA from some other Excel file or a suggestion how I can solve this issue?

Community
  • 1
  • 1
Sabha
  • 621
  • 10
  • 32
  • 1
    You can view the xml structure of an XLSX by [converting it to a ZIP archive](https://stackoverflow.com/questions/8984254/how-to-view-the-xml-form-of-an-excel-file). Look for the images in: `/xl/media/` – cybernetic.nomad Nov 12 '18 at 15:18
  • 1
    Thank you for your quick reply. `/xl/media/` contains only 1 file of 1kb but `\xl\activeX\` folder contains 20,163 files of size 4.47 mb, `\xl\drawings\` folder contains 12 files of size 2.85 mb and `xl\worksheets` folder contains 12 files of size 2.50 mb any suggestion? – Sabha Nov 12 '18 at 15:27
  • 2
    Start removing files from `\xl\activeX`? (I assumed the content that bloated the file so much was images). Do I need to add you should work on a copy of the file? – cybernetic.nomad Nov 12 '18 at 15:35
  • 1
    haha.. i was working on copy of the file anyways. I tried your solution, deleted all activex file, converted back to `.xlsx` and tried opening the file. Initially I got error `Excel found unreadable content in x.xlsx. Do you want to recover the contents of this workbook? If you trust the source of this workbook, click Yes.` I clicked Yes and atleast I was able to open the file. Deleted all objects and now the file size is 222kb. Thank you so much. God bless ! – Sabha Nov 12 '18 at 15:48
  • btw. you can answer the question so that I can accept it! – Sabha Nov 12 '18 at 15:49

1 Answers1

2

You can view the xml structure of an XLSX by converting it to a ZIP archive.

Look for the images in: /xl/media/

As mentioned in your comment, ActiveX content is in \xl\activeX

cybernetic.nomad
  • 6,100
  • 3
  • 18
  • 31