LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Adding Hyperlinks to "Archive"

Hi,
I'm working on a workbook with the following functions.

It contains different kinds of form to fill out. When I press
commandbutton 1 I get a "serial" number from a sheet that contains
these and this is inserted in the form,

afterwards I've got a button to save this form as a pdf, to a
specified location and specified filename. The thing i'm stuck with
now is that i want a hyperlink in a sheet called "archive" this link
is goint to be to the previous saved pdf.

The code I'm using at the moment work fine, but when i press the
"save" button again, it writes over the old hyperlink. Så in other
words, i need to add the hyperlinks with some kind of ofset,
so the link will come one by one in a row. My code:

Sub printandsave()
myfilenumber = CStr(ActiveSheet.Range("E2"))
myfilename = "c:\test\SR-" + myfilenumber +
CStr(ActiveSheet.Range("F2")) + ".pdf"

MsgBox (myfilename)

Application.ActivePrinter = "Win2PDF på Ne00:"
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, _
ActivePrinter:="Win2PDF på Ne00:", Collate:=True,
PrToFilename:=myfilename


End Sub

Sub Archive

myfilenumber = CStr(ActiveSheet.Range("E2"))
myfilename = "c:\test\SR-" + myfilenumber +
CStr(ActiveSheet.Range("F2")) + ".pdf"

ActiveSheet.Hyperlinks.Add Anchor:=Worksheets("archive").Range
'somethings missing here("A1"), Address:=myfilename,
TextToDisplay:="SR-" + myfilenumber + CStr(ActiveSheet.Range("F2")) +
".pdf"


'End Sub

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
"Hyperlinks can be harmfull to your computer and data...." how to shut this off marko Excel Discussion (Misc queries) 0 February 17th 06 12:27 PM
Complex if test program possible? If "value" "value", paste "value" in another cell? jseabold Excel Discussion (Misc queries) 1 January 30th 06 10:01 PM
Insert "-" in text "1234567890" to have a output like this"123-456-7890" Alwyn Excel Discussion (Misc queries) 3 October 25th 05 11:36 PM


All times are GMT +1. The time now is 11:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"