ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Why does hyperlink fail? (https://www.excelbanter.com/excel-discussion-misc-queries/270641-why-does-hyperlink-fail.html)

Terry Pinnell[_2_]

Why does hyperlink fail?
 
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?

--
Terry, East Grinstead, UK

James Ravenswood

Why does hyperlink fail?
 
On Nov 25, 9:05*am, Terry Pinnell wrote:
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?

--
Terry, East Grinstead, UK


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

this works assuming the default app for .txt is NotePad

Terry Pinnell[_2_]

Why does hyperlink fail?
 
James Ravenswood wrote:

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, East Grinstead, UK

Terry Pinnell[_2_]

Why does hyperlink fail?
 
Terry Pinnell wrote:

James Ravenswood wrote:

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?


Anyone able to remind me what steps to get from the above to a working
macro please?

--
Terry, East Grinstead, UK

Cimjet[_3_]

Why does hyperlink fail?
 
Hi Terry
Now go to ToolsMacroMacros 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
"Terry Pinnell" wrote in message
...
Terry Pinnell wrote:

James Ravenswood wrote:

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?


Anyone able to remind me what steps to get from the above to a working
macro please?

--
Terry, East Grinstead, UK




All times are GMT +1. The time now is 06:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com