Share via

disable warning when saving .csv

Anonymous
2013-08-03T13:43:16+00:00

Excel, Office 2010

How to disable saving as .csv warnings?

When I search Microsoft, I get lots of hits from external sites, nothing from Microsoft.

I go to those external sites and they are for programmers offer solutions like VB.

Why can't Microsoft provide an answer for this frequently asked question?

Better yet, documentation on how to disable.

Why does Microsoft offer as a solution third party answers that involve either installing something or programming in VB?

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

5 answers

Sort by: Most helpful
  1. Anonymous
    2017-09-12T13:37:39+00:00

    'Strip extension from current filename:

        strInitFName = ActiveWorkbook.Name

        If InStrRev(ActiveWorkbook.Name, ".") > 0 Then

            strInitFName = Left(strInitFName, InStrRev(strInitFName, ".") - 1)

        End If

       

    'Show SaveAs dialog:    vFileName = Application.GetSaveAsFilename( _

            InitialFileName:=ActiveWorkbook.Name, _

            FileFilter:="CSV (Comma delimited) (*.csv), *.csv")

    I think you forgot to actually really use the stripped filneame (strInitFName) in vFilename, right?

    this worked for me, now it really prefills the "save as filename field" with the original filename (without the ending .csv)

          'Show SaveAs dialog:

        vFileName = Application.GetSaveAsFilename( _

            InitialFileName:=strInitFName, _

            FileFilter:="CSV (Trennzeichen getrennt) (*.csv), *.csv")

    HTH

    Jojo

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2016-12-15T20:53:28+00:00

    I tried this, but it disabled all "save before you exit" warnings, so my other open spreadsheets didn't save when I closed.  Is there a more specific to CSV way to do this?  Thank you.

    Was this answer helpful?

    0 comments No comments
  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  4. Anonymous
    2014-02-18T18:00:52+00:00

    Hello rich007a,

    I tried your code but it keeps getting error specifically on this part.

    'Show SaveAs dialog:    vFileName = Application.GetSaveAsFilename( _

            InitialFileName:=ActiveWorkbook.Name, _

            FileFilter:="CSV (Comma delimited) (*.csv), *.csv")

    May I know how to fix it?

    Error is Run time error 1004. object defined error

    Please help.

    Thanks!

    Ernesto

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2013-08-03T15:14:58+00:00

    When I search Microsoft, I get lots of hits from external sites, nothing from Microsoft.

    Why can't Microsoft provide an answer for this frequently asked question?

    Better yet, documentation on how to disable.

    Hi,

    I feel your pain.  It appears MS have given up writting Help files and relies on surfacing material from third-party websites.  If you want to only see the MS help in the "Help" files, switch to "Show content only from this computer" in the bottom-right corner of the Help window.

    How to disable saving as .csv warnings?

    As for how to disable these warnings, I don't think it is possible via the Graphical User Interface.  But don't be so down on VBA programming.  You can use the following code to give you exactly what you want:

    1. Press Alt+F11 to open the VBE.
    2. In the top-left pane you should see a folder-tree-like structure.  Right-click on "VBAProject (PERSONAL.XLSB)" > Insert Module.

    If you can't see "VBAProject (PERSONAL.XLSB)" then go back to Excel and do View tab > Macros... > Record Macro... > Store macro in: Personal Macro Workbook > OK > then do View tab > Macros... > Stop Recording.  Go back to the VBE and you should now see it.

    1. In the new Module (on the right of the VBE), paste the code below.
    2. In the VBE click the Save button.
    3. Close the VBE and return to Excel.
    4. Right-click on the ribbon at the top of Excel > Customize the Quick Access Toolbar >Choose commands from: Macros, then add your SaveAsCSV macro > OK.
    5. You should now be able to click the button on the QAT to run the SaveAsCSV macro.  A SaveAs dialog will be displayed, but the CSV file type will already be selected, and you wont get any warnings when you click Save.

    Hope that helps.

    Cheers

    Rich

    Here's the code:

    Sub SaveAsCSV()

        Dim vFileName As Variant

        Dim strInitFName As String

    'Strip extension from current filename:    strInitFName = ActiveWorkbook.Name

        If InStrRev(ActiveWorkbook.Name, ".") > 0 Then

            strInitFName = Left(strInitFName, InStrRev(strInitFName, ".") - 1)

        End If

    'Show SaveAs dialog:    vFileName = Application.GetSaveAsFilename( _

            InitialFileName:=ActiveWorkbook.Name, _

            FileFilter:="CSV (Comma delimited) (*.csv), *.csv")

    'Save the file as CSV:    If vFileName <> False Then ActiveWorkbook.SaveAs vFileName, xlCSV

    End Sub

    Was this answer helpful?

    0 comments No comments