daniels012
Well-known Member
- Joined
- Jan 13, 2005
- Messages
- 5,219
How can I change my existing code to save as pdf?
Here is the code:
I think this is the line I need changed? Not sure what i need it to change to?
Any help is greatly appreciated!
Michael
Here is the code:
Code:
Dim strPath As String, strPath2 As String, CurrPath As String
Dim WB1 As Workbook
Dim WB2 As Workbook
Application.ScreenUpdating = False
Set WB1 = ActiveWorkbook
WB1.Save
CurrPath = WB1.Path
strfilename = Range("S16").Value & ".xlsm"
strPath = "C:\Documents and Settings\Owner\My Documents\Completed Proposals\"
strPath2 = "C:\Documents and Settings\Owner\My Documents\Surface Systems\"
On Error Resume Next
WB1.SaveAs Filename:=strPath & strfilename
On Error GoTo 0
Set WB2 = Workbooks.Open(Filename:=strPath2 & "Proposal for XL.xlsm")
Select Case WB1.Sheets("FRONT").Range("C2").Value
Case "MD"
strfilename = "C:\Documents and Settings\Owner\Desktop\Mike Prop\" & strfilename
Case "TD"
strfilename = "C:\Documents and Settings\Owner\Desktop\Tom Prop\" & strfilename
Case "JK"
strfilename = "C:\Documents and Settings\Owner\Desktop\Jon Knorr\" & strfilename
Case "CP"
strfilename = "C:\Documents and Settings\Owner\Desktop\Chuck Prop\" & strfilename
Case "DA"
strfilename = "C:\Documents and Settings\Owner\Desktop\David Prop\" & strfilename
End Select
WB1.SaveCopyAs Filename:=strfilename
WB1.ActiveSheet.Shapes("Button 53").Visible = False
ChDir CurrPath
Application.ScreenUpdating = True
WB1.Close
Code:
WB1.SaveCopyAs Filename:=strfilename
Any help is greatly appreciated!
Michael