Results 1 to 2 of 2

Thread: Save As Error 1004
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Oct 2018
    Posts
    31
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Save As Error 1004

    This is my code:

    Dim New_file_name

    New_file_name = Application.GetSaveAsFilename("Verbruik_LT_" & Format(Now(), "dd-mm-yyyy hh_mm"), "Microsoft Excel Workbook (*.xlsb), *.xlsb")

    Set NewBook = Workbooks.Add

    Verbruik_LT.UsedRange.Copy

    With NewBook.Worksheets("Sheet1").Range("A1")
    .PasteSpecial (xlPasteValuesAndNumberFormats)
    .PasteSpecial (xlPasteColumnWidths)
    .PasteSpecial (xlPasteFormats)
    End With

    NewBook.SaveAs FileName:=New_file_name

    I'm getting error 1004 on the SaveAs. What am I doing wrong?

    Thanks!

  2. #2
    New Member
    Join Date
    Oct 2018
    Posts
    31
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Save As Error 1004

    Solution:
    NewBook.SaveAs FileName:=New_file_name, FileFormat:=xlExcel12

    Seems to work...

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •