Hi,
I'm trying to write a code which will prompt user to select a file and the selected file should get saved in the location specified in cell A1 in the master file (note i'll be running macro from the master file). When i run the below code i'm getting an error message stating object required.
Sub Test()
'path specified in master file
Dim a As String
a = Cells(1, 1).Value
'prompt the user to select a file
Dim filename
filename = Application.GetOpenFilename
'upon selecting file, it should get saved in the path specified in A1 cell in master file
If filename <> False Then
filename.SaveAs "a"
End If
End Sub
Bookmarks