G Guest Oct 28, 2004 #1 Is it possible in a hyperlink, to make it first copy a file to a new location and then open the new copy?
Is it possible in a hyperlink, to make it first copy a file to a new location and then open the new copy?
D Dave Peterson Oct 28, 2004 #2 Not via a hyperlink. But maybe you could use a macro that accomplishes this. Look at filecopy in VBA's help and workbooks.open. For example, I could put a shape on the the worksheet, rightclick and assign it this macro: Option Explicit Sub testme() Dim myFromFolder As String Dim myToFolder As String Dim myFileName As String myFromFolder = "C:\my documents\excel\" myToFolder = "C:\my documents\excel\test\" myFileName = "book1.xls" FileCopy Source:=myFromFolder & myFileName, _ Destination:=myToFolder & myFileName Workbooks.Open myToFolder & myFileName End Sub
Not via a hyperlink. But maybe you could use a macro that accomplishes this. Look at filecopy in VBA's help and workbooks.open. For example, I could put a shape on the the worksheet, rightclick and assign it this macro: Option Explicit Sub testme() Dim myFromFolder As String Dim myToFolder As String Dim myFileName As String myFromFolder = "C:\my documents\excel\" myToFolder = "C:\my documents\excel\test\" myFileName = "book1.xls" FileCopy Source:=myFromFolder & myFileName, _ Destination:=myToFolder & myFileName Workbooks.Open myToFolder & myFileName End Sub