ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Hyperlink question (https://www.excelbanter.com/excel-programming/383207-hyperlink-question.html)

dd

Hyperlink question
 
I have a list of hyperlinks - to an unusual filetype. When the user clicks
on a link, a message box appears stating "unable to open file".

I want to set it up so that excel asks the user where to save the file,
rather than try to open it.

Regards
Dylan



[email protected]

Hyperlink question
 
I would use either the file scripting object to kick off a save as
dialog of the application.filedialogs

Regards,
Eddie
http://HelpExcel.com


Gary''s Student

Hyperlink question
 
Let's say in A1 thru A20 we have a list of hyperlinks. They are all set to
place in this documents. The "friendly" names are the file names:

file1.arg
fil4.narfl
procedure.qwerty
..
..
..


So column A has both hyperlinks and the desired filenames/types
A1 links to Z1
A2 links to Z2
A3 links to Z3
..
..
..

So clicking on A1 just takes you to Z1.

We also have the following Event macro in worksheet code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(Range("Z:Z"), Target) Is Nothing Then
Exit Sub
End If
v = Cells(Target.Row, 1).Value
s = Application.InputBox("Enter Path for file save", 2)
ChDir s
If Right(s, 1) < "\" Then
s = s & "\"
End If
ActiveWorkbook.SaveAs Filename:=s & v
End Sub

So clicking on A1 gets us to Z1 and getting to Z1 trips the macro. The user
supplies the path and column A supplies the filename
--
Gary''s Student
gsnu200705


"dd" wrote:

I have a list of hyperlinks - to an unusual filetype. When the user clicks
on a link, a message box appears stating "unable to open file".

I want to set it up so that excel asks the user where to save the file,
rather than try to open it.

Regards
Dylan




dd

Hyperlink question
 
I can see where you're going with a worksheet selection change event. I
don't understand how I link D8 to Z8, when the cell already contains a
hyperlink to the external file.

What does this do?
file1.arg
fil4.narfl
procedure.qwerty

My workbook contains code to find and populate the sheet with files found of
a specific filetype.

My hyperlinks start on Row 8 and are made up of adding together Cell
B3+A8+B8+C8 (or whatever Row it is)

"Gary''s Student" wrote in message
...
Let's say in A1 thru A20 we have a list of hyperlinks. They are all set to
place in this documents. The "friendly" names are the file names:

file1.arg
fil4.narfl
procedure.qwerty
..
..
..


So column A has both hyperlinks and the desired filenames/types
A1 links to Z1
A2 links to Z2
A3 links to Z3
..
..
..

So clicking on A1 just takes you to Z1.

We also have the following Event macro in worksheet code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(Range("Z:Z"), Target) Is Nothing Then
Exit Sub
End If
v = Cells(Target.Row, 1).Value
s = Application.InputBox("Enter Path for file save", 2)
ChDir s
If Right(s, 1) < "\" Then
s = s & "\"
End If
ActiveWorkbook.SaveAs Filename:=s & v
End Sub

So clicking on A1 gets us to Z1 and getting to Z1 trips the macro. The user
supplies the path and column A supplies the filename
--
Gary''s Student
gsnu200705


"dd" wrote:

I have a list of hyperlinks - to an unusual filetype. When the user
clicks
on a link, a message box appears stating "unable to open file".

I want to set it up so that excel asks the user where to save the file,
rather than try to open it.

Regards
Dylan






Gary''s Student

Hyperlink question
 
From your original posting, I got that you had hyperlinks to files and that
you wanted clicking on the link to start a SaveAs dialog rather than a GoTO
dialog.

I got that the link should supply the filename/filetype and the dialog would
supply the path for the save.

For normal hyperlink operation, click on the link causes the system to try
to either goto the file or open the file.

The option I suggested was to have the hyperlink goto a column in the code.
Getting there would trigger a macro. Because the macro "knows" from what row
on the column it was called, it can get the filename/type from the original
hyperlink.

The InputBox gets the user to supply whaere the file should be saved and the
macro completes the save.

This is just an option. I have used it before for users who want a
one-click way to start a macro.
--
Gary''s Student
gsnu200706


"dd" wrote:

I can see where you're going with a worksheet selection change event. I
don't understand how I link D8 to Z8, when the cell already contains a
hyperlink to the external file.

What does this do?
file1.arg
fil4.narfl
procedure.qwerty

My workbook contains code to find and populate the sheet with files found of
a specific filetype.

My hyperlinks start on Row 8 and are made up of adding together Cell
B3+A8+B8+C8 (or whatever Row it is)

"Gary''s Student" wrote in message
...
Let's say in A1 thru A20 we have a list of hyperlinks. They are all set to
place in this documents. The "friendly" names are the file names:

file1.arg
fil4.narfl
procedure.qwerty
..
..
..


So column A has both hyperlinks and the desired filenames/types
A1 links to Z1
A2 links to Z2
A3 links to Z3
..
..
..

So clicking on A1 just takes you to Z1.

We also have the following Event macro in worksheet code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(Range("Z:Z"), Target) Is Nothing Then
Exit Sub
End If
v = Cells(Target.Row, 1).Value
s = Application.InputBox("Enter Path for file save", 2)
ChDir s
If Right(s, 1) < "\" Then
s = s & "\"
End If
ActiveWorkbook.SaveAs Filename:=s & v
End Sub

So clicking on A1 gets us to Z1 and getting to Z1 trips the macro. The user
supplies the path and column A supplies the filename
--
Gary''s Student
gsnu200705


"dd" wrote:

I have a list of hyperlinks - to an unusual filetype. When the user
clicks
on a link, a message box appears stating "unable to open file".

I want to set it up so that excel asks the user where to save the file,
rather than try to open it.

Regards
Dylan








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

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