daniels012
Well-known Member
- Joined
- Jan 13, 2005
- Messages
- 5,219
I have the code below. It always saves to the desktop. And then I have to move it manually to the correct Dropbox Folder. Any Idea Why?
Is there something in the code that would not be working with older Excel files since I am using (Excel 97/2000) compatibility mode?
Thank You for any help!
Michael
Is there something in the code that would not be working with older Excel files since I am using (Excel 97/2000) compatibility mode?
Thank You for any help!
Michael
Code:
Sub SaveToClientsOrDesktop()
Dim DBPath As String, myFileName As String, DTAddress As String, ans As String, DBPathEstim As String
myFileName = Worksheets("Estimating").Range("A10").Value & ".xls"
DBPath = Left(Application.ThisWorkbook.Path, Len(Application.ThisWorkbook.Path) - 19) & "Clients\"
DBPathEstim = Left(Application.ThisWorkbook.Path, Len(Application.ThisWorkbook.Path) - 19) & "SurfaceSystemsFIles\Estimating2010.xls"
DTAddress = CreateObject("WScript.Shell").SpecialFolders("Desktop") & Application.PathSeparator
If Dir(DBPath, vbDirectory) <> "" Then
ActiveWorkbook.SaveAs DBPath & myFileName
Else
ActiveWorkbook.SaveAs DTAddress & myFileName
MsgBox "Be sure to go to the desktop, move your saved file into to dropbox. "
End If
ans = MsgBox("Do you want to do another Estimating sheet FOR THIS SAME CLIENT?", vbQuestion + vbYesNo, "???")
If ans = vbNo Then
ActiveWorkbook.Close
Else
Workbooks.Open DBPathEstim
Workbooks(myFileName).Worksheets("Worksheet").Range("B5:B18").Copy Destination:=Workbooks("Estimating2010.xls").Worksheets("Worksheet").Range("B5")
Workbooks(myFileName).Close
'EraseWorksheetLeaveAddress
End If
End Sub