none
Err Number: 1004; Method of ~ or Object ~ failed RRS feed

  • Question

  • Hello,

    I am getting error when creating excel file using VBA.

    Err Number: 1004; Method of ~ or Object ~ failed

    Please assist

    Thank you!!


    Jothe Rengarajan

    Tuesday, December 8, 2015 10:11 AM

Answers

  • Hi Jothe,

    To create a new workbook, we could use Workbooks.Add method.

    Simple code:

    Set NewBook = Workbooks.Add
        With NewBook
            .Title = "All Sales"
            .Subject = "Sales"
            .SaveAs Filename:="Allsales.xlsx"
        End With
    

    Please check your code.

    Regards

    Starain


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, December 10, 2015 4:46 AM
    Moderator

All replies