Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Eric
 
Posts: n/a
Default Macros associated with pictures

I am working with Excel 2000.

I have a worksheet that has several pictures on it. Each picture has an
associated macro. The macros are in an extenal workbook. Currently each
picture, when it tries to access the macro, it cannot find the file, because
the file containing the macros has been moved. I have a number of files
that are setup this way and need a macro that will go in and automatically
remove the folder/path refference from the file/macro reference.

Example:
Currently referenced macro:
F:\Dir1\SubDir2\SubSubDir3\OperatorMacros.xls!Pict ure6_Click

I want it to read:
OperatorMacros.xls!Picture6_Click

I have 6 pictures on the worksheet and each picture has the same problem.

Also, can I set something such that it doesn't ever try to reference a path
for the file. I already have the workbook set up to make sure the file that
has the macros in it is loaded.

Please help, and thank you in advance.

Eric Pearce


  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

Put your macros in an add-in, and install the ad-in.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Eric" wrote in message
...
I am working with Excel 2000.

I have a worksheet that has several pictures on it. Each picture has an
associated macro. The macros are in an extenal workbook. Currently each
picture, when it tries to access the macro, it cannot find the file,

because
the file containing the macros has been moved. I have a number of files
that are setup this way and need a macro that will go in and automatically
remove the folder/path refference from the file/macro reference.

Example:
Currently referenced macro:
F:\Dir1\SubDir2\SubSubDir3\OperatorMacros.xls!Pict ure6_Click

I want it to read:
OperatorMacros.xls!Picture6_Click

I have 6 pictures on the worksheet and each picture has the same problem.

Also, can I set something such that it doesn't ever try to reference a

path
for the file. I already have the workbook set up to make sure the file

that
has the macros in it is loaded.

Please help, and thank you in advance.

Eric Pearce




  #3   Report Post  
Eric
 
Posts: n/a
Default

Though I cannot remember the specifics, I tried an Add-in and it would not
work the way I needed it to. However, with a little effort I was able to
identify the fix.

Dim theShapes As Shapes
Set theShapes = Workbooks(ActiveBook).Worksheets(1).Shapes
myFile = "OperatorMacros.xls"
For i = 1 To theShapes.Count
Select Case i
Case Is = 2
theShapes.Item(i).OnAction = myFile & "!Picture6_Click"
Case Is = 3
theShapes.Item(i).OnAction = myFile & "!Picture7_Click"
Case Is = 4
theShapes.Item(i).OnAction = myFile & "!Picture9_Click"
Case Is = 5
theShapes.Item(i).OnAction = myFile & "!Picture11_Click"
Case Is = 6
theShapes.Item(i).OnAction = myFile & "!Picture10_Click"
Case Is = 7
theShapes.Item(i).OnAction = myFile & "!Picture8_Click"
End Select
Next i

Allowed me to loop through each picture and reset the macro reference.

I do appreciate the suggestion, and maybe would have found some help with
the whole add-in issue had I asked, but thank you for your time anyway.

Eric Pearce

"Bob Phillips" wrote in message
...
Put your macros in an add-in, and install the ad-in.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Eric" wrote in message
...
I am working with Excel 2000.

I have a worksheet that has several pictures on it. Each picture has

an
associated macro. The macros are in an extenal workbook. Currently

each
picture, when it tries to access the macro, it cannot find the file,

because
the file containing the macros has been moved. I have a number of files
that are setup this way and need a macro that will go in and

automatically
remove the folder/path refference from the file/macro reference.

Example:
Currently referenced macro:
F:\Dir1\SubDir2\SubSubDir3\OperatorMacros.xls!Pict ure6_Click

I want it to read:
OperatorMacros.xls!Picture6_Click

I have 6 pictures on the worksheet and each picture has the same

problem.

Also, can I set something such that it doesn't ever try to reference a

path
for the file. I already have the workbook set up to make sure the file

that
has the macros in it is loaded.

Please help, and thank you in advance.

Eric Pearce






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
sharing macros fabulousk Excel Discussion (Misc queries) 3 March 7th 05 10:05 PM
Enabling macros Peter M Excel Discussion (Misc queries) 3 February 7th 05 10:57 PM
sorting with macros Sorting in macros Excel Discussion (Misc queries) 1 February 1st 05 09:02 AM
Transferring toolbars and macros to other computers Darrell Excel Discussion (Misc queries) 1 January 19th 05 12:21 AM
The available macros list in XL; how to suppress filename from showing KR Excel Discussion (Misc queries) 1 January 10th 05 07:20 PM


All times are GMT +1. The time now is 09:12 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"