0

I am close on this but not quite there. I am trying to save the top worksheet only (List for Mailchimp) as a separate worksheet once the calculations are finished. Right now I am getting errors and in a perfect world it would prompt the user to name the file and pick a place to save it while setting the saved format to .csv But at this point I would settle for just not getting errors on the saveAs

Sub SaveSheet()
'
' SaveSheet Macro
'

'
Dim wb As Workbook
Set wb = Workbooks.Add
ThisWorkbook.Sheets("List for Mailchimp").Copy Before:=wb.Sheets(1)
wb.SaveAs Filename:= _
    MyFileName, _
    CreateBackup:=False

End Sub

Currently I am getting "file could not be accessed" error plus suggestions (full error in the screenshot following). I appreciate any suggestions. Thx. enter image description here

Community
  • 1
  • 1
  • MyFileName, what is its content? can you display it in msgbox? – D. O. Dec 15 '16 at 21:00
  • 1
    @D.O. MyFileName is nothing in the context as it wasn't declared or initialized....hence probably why the error. – Sorceri Dec 15 '16 at 21:01
  • yes, it is the problem!!! if you want to SaveAs, then you have to give the name of the file, and the path if you need – D. O. Dec 15 '16 at 21:03
  • ok, so if I remove everything after "Before:=wb.Sheets(1) it will at least still create the new copy? – waterwalk77 Dec 15 '16 at 21:46

0 Answers0