From: Terry Galentine on 28 May 2010 15:40 I have an VB script that has worked fine for any XP box. The script does a save as PDF (using the save as pdf add in) for excel, then save the pdf in a file within SharePoint on an external site. As we plan on moving to Windows 7 we have tested this and have issues with the file acturally saving. it creates a file put the file is empty. this also happens on Vista. but has no issues when it comes to XP. Applications: Office 2007 SP 2 MOSS SP1 Save as PDF add-in Script: Private Sub CommandButton1_Click() Dim iReply As Integer iReply = MsgBox(Prompt:="By using my login and submitting my time for this pay period, I understand that the information submitted will be attributed to me and is true and accurate to the best of my knowledge.", _ Buttons:=vbYesNoCancel, Title:="Submit Timesheet") If iReply = vbYes Then ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _ "https://esign/Employee%20Time%20Sheets/" & Range("c6").Value & "/" & Range("AT2").Value & ".pdf" _ , Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _ :=False, OpenAfterPublish:=False CreateObject("WScript.Shell").Popup "Timesheet Submitted", _ 5, "Timesheet has been successfully submitted, closing timesheet." ActiveWorkbook.Close False ' closes the active workbook without saving any changes ElseIf iReply = vbNo Then CreateObject("WScript.Shell").Popup "Timesheet Not Submitted", _ 5, "Timesheet was not submitted, closing timesheet." Else 'They cancelled (VbCancel) Exit Sub End If End Sub
From: Ron de Bruin on 28 May 2010 16:02 Hi Terry Do you have also problems with my example workbook on this page http://www.rondebruin.nl/pdf.htm -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Terry Galentine" <TerryGalentine(a)discussions.microsoft.com> wrote in message news:D74C70B9-9A36-430A-9904-1DCB4D710173(a)microsoft.com... > I have an VB script that has worked fine for any XP box. The script does a > save as PDF (using the save as pdf add in) for excel, then save the pdf in a > file within SharePoint on an external site. As we plan on moving to Windows > 7 we have tested this and have issues with the file acturally saving. it > creates a file put the file is empty. this also happens on Vista. but has > no issues when it comes to XP. > > Applications: > Office 2007 SP 2 > MOSS SP1 > Save as PDF add-in > > Script: > Private Sub CommandButton1_Click() > Dim iReply As Integer > iReply = MsgBox(Prompt:="By using my login and submitting my time for > this pay period, I understand that the information submitted will be > attributed to me and is true and accurate to the best of my knowledge.", _ > Buttons:=vbYesNoCancel, Title:="Submit Timesheet") > If iReply = vbYes Then > ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _ > "https://esign/Employee%20Time%20Sheets/" & Range("c6").Value & "/" > & Range("AT2").Value & ".pdf" _ > , Quality:=xlQualityStandard, IncludeDocProperties:=True, > IgnorePrintAreas _ > :=False, OpenAfterPublish:=False > CreateObject("WScript.Shell").Popup "Timesheet Submitted", _ > 5, "Timesheet has been successfully submitted, closing timesheet." > ActiveWorkbook.Close False > ' closes the active workbook without saving any changes > ElseIf iReply = vbNo Then > CreateObject("WScript.Shell").Popup "Timesheet Not Submitted", _ > 5, "Timesheet was not submitted, closing timesheet." > Else 'They cancelled (VbCancel) > Exit Sub > End If > End Sub >
|
Pages: 1 Prev: export data between spreadsheets Next: Need VBA Code to Select text boxes in spreadsheet |