Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Another Hyperlink question | Excel Worksheet Functions | |||
Hyperlink Question | Excel Discussion (Misc queries) | |||
Hyperlink question | Excel Programming | |||
Hyperlink Question | Excel Discussion (Misc queries) | |||
hyperlink question | Excel Discussion (Misc queries) |