Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
HELP on "left","right","find","len","substitute" functions | Excel Discussion (Misc queries) | |||
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next | New Users to Excel | |||
"Hyperlinks can be harmfull to your computer and data...." how to shut this off | Excel Discussion (Misc queries) | |||
Complex if test program possible? If "value" "value", paste "value" in another cell? | Excel Discussion (Misc queries) | |||
Insert "-" in text "1234567890" to have a output like this"123-456-7890" | Excel Discussion (Misc queries) |