Suppose I want a create a new excel workbook(blank) using macros and the user should be prompted to enter the file name and location, the new file should not overwrite some existing file with the same name that user has entered
The name of file that user has entered should be saved in some cell of the existing sheet in which I am running the macros
Till now I have been using this
Workbooks.Add
Dim file_name As Variant
ActiveWorkbook.file_name = _
Application.GetSaveAsFilename(FileFilter:="Microsoft Excel file (*.xls), *.xls")
I don't know how to copy the name to the cell
I am getting error message: Run-time error'438' with the above code
I don't know how to fix it, I am a beginner, some help please