MrExcel Publishing
Your One Stop for Excel Tips & Solutions

getting rid of saving warnings from VBA


Posted by matthew cullen on January 08, 2002 8:31 AM

I have a macro which copies an Excel spreadsheet into a .txt file and then closes the .txt file. At this point I get a warning pop up box telling me that the file is not in excel format and do I want to save it as an .xls file to which I reply No. As this is all in a loop I end up pressing n several times. I used to get round this problem using the sendkeys command from vba but this seems to have stopped working. Do you have any ideas why sendkeys isn't working and how I can get round the problem


Posted by faster on January 08, 2002 9:23 AM

You might try turning off the warnings. Make sure
you turn them back on though.

Sub X()
Application.DisplayAlerts = False

'your code

Application.DisplayAlerts = True

End Sub