Hi,
This may sound a stupid question but I am struggling to make this piece of code to suit my requirement
The objective
I require a macro assigned to a command button on a userform that when pressed will save the active workbook to a directory (the directory is hardcode in) and the user uses an input box to name the file. Simple right ?
Maybe its that Friday feeling but as simple as this may seem I haven't been able to find a solution
This is what I have managed to muster so far
The code runs put fails on the:-![]()
Sub Save_File_Name() Dim fname, fpath fname = InputBox("enter a name") fname = fname & ".xlsm" fpath = "K:\BP DATA\SALES PRODUCTS\SALES\2018\Data\" ActiveWorkbook.SaveAs fpath & fname End Sub
Run-time error '1004'
Method 'SaveAs' of object'_workbook' failed
Any ideas guys ?
Thanks
Slosh
Bookmarks