Need to clean some lines in corrupt text (.vml) file so I can open workbook

satheo

New Member
Joined
Jun 10, 2014
Messages
34
I've got a workbook with employee info and the name column has commented pictures in it - it seems the xl\drawings\vmlDrawing1.vm<wbr style="font-size: 14px; font-family: 'Open Sans', sans-serif; line-height: 20px;">l file has been corrupted from me changing things around too much or something, resulting in conflicting relationship ID's for most of the images. Excel doesn't like this and attempts a repair upon opening the file which just removes all the comments. There are over 700 images so I can't really do this manually (though I suppose I will if I have to).

Basically I need to turn this:
Code:
v:fill o:relid="rId15" o:relid="rId15" o:relid="rId15" o:relid="rId15"   
o:relid="rId15" o:relid="rId15" o:relid="rId15" o:relid="rId15" o:relid="rId15"
   o:relid="rId15" o:relid="rId15" o:relid="rId15" o:relid="rId15" o:relid="rId15"
   o:relid="rId15" o:relid="rId15" o:relid="rId15" o:relid="rId15" o:relid="rId15"
   o:relid="rId15" o:relid="rId15" o:relid="rId15" o:relid="rId15" o:relid="rId15"
   o:relid="rId15" o:relid="rId15" o:relid="rId15" o:relid="rId15" o:relid="rId15"
   o:relid="rId15" o:relid="rId15" o:relid="rId15" o:relid="rId15" o:relid="rId15"
   o:relid="rId15" o:relid="rId15" o:relid="rId15" o:relid="rId15" o:relid="rId15"
   o:relid="rId15" o:relid="rId14" o:relid="rId14" o:relid="rId14" o:relid="rId14"
   o:relid="rId14" o:relid="rId14" o:relid="rId14" o:relid="rId14" o:relid="rId14"
   o:relid="rId14" o:relid="rId14" o:relid="rId14" o:relid="rId14" o:relid="rId14"
   o:relid="rId14" o:relid="rId14" o:relid="rId14" o:relid="rId14" o:relid="rId14"
   o:relid="rId14" o:relid="rId14" o:relid="rId14" o:relid="rId14" o:relid="rId14"
   o:relid="rId14" o:relid="rId14" o:relid="rId14" o:relid="rId14" o:relid="rId14"
   o:relid="rId14" o:relid="rId14" o:relid="rId14" o:relid="rId14" o:relid="rId14"
   o:relid="rId14" o:relid="rId14" o:relid="rId14" o:relid="rId14" o:relid="rId14"
   o:relid="rId14" o:relid="rId14" o:relid="rId14" o:relid="rId14" o:relid="rId14"
   o:relid="rId14" o:relid="rId14" o:relid="rId13" o:title="g" color2="#ffffe1"
   type="frame"

into:
Code:
v:fill o:relid="rId13" o:title="g" color2="#ffffe1"
   type="frame"

I'm not too good with VBA, but I think I'd just need something that deletes each o:relid expression unless that expression is immediately followed by an o:title (the last rId is the correct one). Any help is greatly appreciated.
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
I suppose I can do this manually, but is there a way to make sure this doesn't happen again? I have the file saved as a .xlsm, if that matters.
 
Upvote 0
Ok another update, I have been able to separate the unwanted o:relid statements into their own cells just by using replace and with the add data from text feature. So now all I need is a macro to delete any cell unless it contains the phrase "o:title". Alternatively, deleting any cell with less than 18 characters would work too, if that is any easier.
 
Upvote 0
Almost have it I think, I found the solution on microsoft support forums, looking to run the code posted by scadam towards the bottom of the page but not sure how?

edit - forgot link
 
Upvote 0
I don't need any of the fancy drag and drop stuff, just need to figure out how to make the code work.
 
Upvote 0

Forum statistics

Threads
1,216,730
Messages
6,132,388
Members
449,725
Latest member
Enero1

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