PDA

View Full Version : Hyperlink problem



palbiro
06-20-2012, 04:21 AM
I have 2 files in a network drive (Y)
1.) I assign (in Macros.xlsm) a macro to a button in the other file (button.xlsm)
2.) I make a hyperlink to the button.xlsm

The Code in Macros.xlsm

Sub Test()
ChDrive "Y" 'My network drive
ChDir "Y:\temp"

Workbooks.Open Filename:="Button.xlsm", UpdateLinks:=0
Sheets("F").Shapes("M").OnAction = "Macros.xlsm!Copy"
ActiveWorkbook.Close SaveChanges:=True

Cells(1, 1).Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, _
Address:=CurDir + "\Button.xlsm", _
TextToDisplay:=CurDir
End Sub

Sub Copy()
Cells(1, 1) = "Success"
End Sub



If I open the button.xlsm
1.) from Explorer, everythings works perfect, the macroassignment is:
Macros.xlsm!Copy

2.) trough the hyperlink, the macroassigment is:
\\ganymede\infor\Temp\Macros.xlsm!Copy
in the second case pushing the button, I get an error message: the macro in the file inaccessible or the macros are banned.

I have to open my files trough hyperlink, what do I have to do.

I am working with MS Server 2003, SP2. Excel 2010.

I attached the files, if you want to test it, you have to open Macros.xlsm, and run Test.
Thank you very much for your time and help!

palbiro
06-25-2012, 12:38 AM
I am very sad, that nobody can or will help me. Without solving this problem, I can't fulfill my work. Please, your help or hint where to look for a solution would be really useful, you could spare sleepless nights for me.
Thanks!

palbiro
06-25-2012, 08:05 AM
It works perfect with Excel 2003, but not with 2010.