Save macro not working

m_court15

New member
Joined
Jan 9, 2014
Messages
1
Reaction score
0
Points
0
I made a quick macro to save an excel sheet to a certain location and with a certain name depending on the cell value. The macro is executed when I push a custom button on the quick access tool bar. It worked great for a while and now it is not working at all. It will close the document, but not save it. Any ideas what I could be missing?


Sub ECN_SAVE()
THISFILE = Range("R3").Value
FILETHIS = Range("Q6").Value
ActiveWorkbook.SaveAs Filename:="I:\ECN\New Ecn's\" & FILETHIS & "_" & THISFILE
ActiveWorkbook.Close
End Sub


A little more background. I has this associated with an excel sheet that I saved and put in the excel start up folder. I tried changing it so the macro would be there with no docuements open. It worked twice and then stopped working. This should be able to run without a certain document open, right?
 
1: Stating the obvious you checked that the current workbook with the current sheet has defined R3 and Q6?

2: Lost mapped drive/folder

3: Reserved words/spaces in R3/Q6 I would wrap the whole thing in quotes
sFilename = """" & "I:\ECN\New Ecn's\" & FILETHIS & "_" & THISFILE & """"

Good idea to throw a check of
if vbyes = msgbox("saving file to" & vbcrlf & sFilename",vbyesno,"Confirm saving location") then

ActiveWorkbook.SaveAs Filename:= SFilename

4: File already exisiting/ or admin write issues


 
Back
Top