Why does hyperlink fail?

  • Thread starter Thread starter Terry Pinnell
  • Start date Start date
T

Terry Pinnell

Using Excel 2000 (under Windows XP) I cannot get a hyperlink of the form
ProgramXYZ.exe FileToOpen.ext
to work. It fails with the rather unhelpful message "An unexpected error
has occurred."

I've tried several simple examples, such as:
notepad.exe C:\Test.txt
or
C:\windows notepad.exe C:\Test.txt
but all fail. They work fine as normal shortcuts or in the Run box.

Anyone have any insights into this please? Or how to work around it?
 
Using Excel 2000 (under Windows XP) I cannot get a hyperlink of the form
ProgramXYZ.exe FileToOpen.ext
to work. It fails with the rather unhelpful message "An unexpected error
has occurred."

I've tried several simple examples, such as:
notepad.exe C:\Test.txt
or
C:\windows notepad.exe C:\Test.txt
but all fail. They work fine as normal shortcuts or in the Run box.

Anyone have any insights into this please? Or how to work around it?

Sub Macro1()
x = Shell("cmd.exe /c C:\temp\x.txt", 1)
End Sub

this works assuming the default app for .txt is NotePad
 
James Ravenswood said:
Sub Macro1()
x = Shell("cmd.exe /c C:\temp\x.txt", 1)
End Sub

Thanks James. But I'm VERY rusty on this - years since I wrote any Excel
macros. After copying that to the clipboard and opening Tools > Macro >
Visual Basic Editor, do I just paste that into the empty Personal.XLS that
appears? If so, then what?
 
Terry Pinnell said:
Thanks James. But I'm VERY rusty on this - years since I wrote any Excel
macros. After copying that to the clipboard and opening Tools > Macro >
Visual Basic Editor, do I just paste that into the empty Personal.XLS that
appears? If so, then what?

Anyone able to remind me what steps to get from the above to a working
macro please?
 
Hi Terry
Now go to Tools>Macro>Macros and select Personal.XLS!Macro1
if you didn't change the name of the macro then press Run.
Also you could create a button to execute the macro.
HTH
Cimjet
 
Back
Top