How do I open a .xls file attachment?

Saving in different file format

  • QUESTION: I'm trying to save a file in a normal coding (format) (the same type of coding, as a newly opened workbook has). To do this I'm trying to use the following line of vba code: ActiveWorkbook.SaveAs (examplename1.xls, 56) but I get an syntax error ("= expected") When try: ActiveWorkbook.SaveAs (examplename1.xls) it works, but still saves the file in wrong format. I want to change the format, so I don't recieve the following message (attachment), when saving a file. Could you please help me? Best Kuba ANSWER: Kuba, Application.DisplayAlerts = False Activeworkbook.SaveAs FileName:="Exampleaname1.xls", Fileformat:=56 Application.DisplayAlerts = True ---------- FOLLOW-UP ---------- QUESTION: I've entered the code you recomend, but I get the following error when I run it but I get the error: Run-time Error 1004 Method 'SaveAs' of object' _Workbook failed. When I remove the part ,Fileformat:=56 it works fine. It also doesn't work for any of my files (even a new workbook). I'm using2003 (could this be the reson?) Thank You for your help. Kind Kuba

  • Answer:

    Kuba, yes,2003 didn't have a constant that identified the file type 56. in Excel 2003, that is the normal file format. Inxl2003 you should use Application.DisplayAlerts = False Activeworkbook.SaveAs FileName:="Exampleaname1.xls", Fileformat:=xlWorkbookNormal Application.DisplayAlerts = True

Miningco.com Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.