N
NewSysAdmin
I've created a button with a macro assigned to it. I'm trying to save and
close an Excel file, then close the application. Then I would like to copy
it to another location (to do a type of sync operation). The user would
click the button each time they make changes. The code below is not copying
the file to the new location. Can anyone help me? Thank you so much.
Sub Rectangle1_Click()
Dim FromFileName As String
Dim ToFileName As String
Workbooks("Book1.xls").Save
Workbooks("Book1.xls").Close
Application.Quit
FromFileName = "C:\Ole\Book1.xls"
ToFileName = "C:\Blue\Book1.xls"
FileCopy Source:=FromFileName, Destination:=ToFileName
End Sub
close an Excel file, then close the application. Then I would like to copy
it to another location (to do a type of sync operation). The user would
click the button each time they make changes. The code below is not copying
the file to the new location. Can anyone help me? Thank you so much.
Sub Rectangle1_Click()
Dim FromFileName As String
Dim ToFileName As String
Workbooks("Book1.xls").Save
Workbooks("Book1.xls").Close
Application.Quit
FromFileName = "C:\Ole\Book1.xls"
ToFileName = "C:\Blue\Book1.xls"
FileCopy Source:=FromFileName, Destination:=ToFileName
End Sub