Macro to Modify a Macro?

C

ChadDiesel

We have a folder full of spreadsheets that contain a drawing (picture)
which has the following macro run when the drawing is clicked:

Sub Picture1_Click()
Workbooks.Open Filename:="S:\share\drive\Part_Component_Drawing.xls"
End Sub

This opens a spreadsheet containing a component drawing. This works
fine, but the problem is that the directory the drawing is in has
changed to another path such as:

S:\share\drive\drawings\Part_Component_Drawing.xls

The link no longer works, because the path is wrong.

Is there a way to automate changing the file path in the Visual Basic
Editor (find/replace) for hundreds of spreadsheets in a folder?

These Excel files are mixed in with other Excel files that do not
contain this macro.

I tried recording a macro, but it stopped recording when I entered the
Visual Basic Editor.

Is there a way to accomplish this?

Thanks,

-Chad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top