daniels012
Well-known Member
- Joined
- Jan 13, 2005
- Messages
- 5,219
In my code below I have this line of code
Here is my code
Thank You,
Michael
I would like to send this file by email if possible instead of to his computer. The user recently went from a desktop "in the office" to a laptop "all over the place".Case "TD"
strfilename = "\\Tomsblackibm\TomsProposals\" & strfilename
Here is my code
Code:
Sub Save_and_SaveSalesman()
Dim strPath As String, strPath2 As String, CurrPath As String
Dim WB1 As Workbook
Dim WB2 As Workbook
Set WB1 = ActiveWorkbook
'First thing, save my work
WB1.Save
CurrPath = WB1.Path
'ASSUMING THAT C6 and O3 are BOTH in WB1
'move this line HERE: only do this once, and concatenate in the Select..Case later
'doing thsi inside the Select..Case pulls values from WB2, which might cause errors...
strfilename = Range("C6").Value & Range("O3").Value & ".xls"
strPath = "C:\Documents and Settings\Owner\My Documents\Completed Proposals\"
strPath2 = "C:\Documents and Settings\Owner\My Documents\Surface Systems\"
On Error Resume Next
'I then want to save my file as "Proposal" and the number in Cell O3
WB1.SaveAs Filename:=strPath & strfilename
On Error GoTo 0
'I call this workbook "new_file"
'as long as you use the WB1 object, you should not need to store the name... - PES
' new_file = wb1.Name
'you should never need to select anything... - PES
' Range("F2").Select
'I want to open "Proposal for XL" so I can make a 2nd copy to the salesmans computer
Set WB2 = Workbooks.Open(Filename:=strPath2 & "Proposal for XL.xls")
'I have to save the "new_file"
'WHY??? you did this above - PES
' Workbooks(new_file).Save
'Workbooks(new_file).Close
'Here is where i need to choose the computer for it to go to. As well as give the file a name that the salesman recognizes. C6 is customer name and O3 is the proposal number
'Select Case WB2.Sheets("FRONT").Range("C2").Value
Select Case WB1.Sheets("FRONT").Range("C2").Value
Case "MD"
strfilename = "\\MIKESRGATEWAY\MikesProposals\" & strfilename
Case "TD"
strfilename = "\\Tomsblackibm\TomsProposals\" & strfilename
Case "DJ"
strfilename = "\\DAVEJONES\DavesProposals\" & strfilename
Case "CP"
strfilename = "\\Chuckscomputer\daily\" & strfilename
End Select
WB1.SaveCopyAs Filename:=strfilename
WB1.ActiveSheet.Shapes("Button 53").Visible = False
ChDir CurrPath
Application.ScreenUpdating = True
WB1.Close
End Sub
Thank You,
Michael