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
Related Q & A:
- What Is MSI File And How Is It Different From EXE File?Best solution by Stack Overflow
- How to limit the number of decimal digits in ARCGIS to have the exported file in CAD with the same format?Best solution by Geographic Information Systems
- How to file state taxes while W-2 from two states (different employer?Best solution by Yahoo! Answers
- How do I file taxes when I worked in two different states?Best solution by Yahoo! Answers
- How is .txt file different from a .dat file in C?Best solution by mycplus.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
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.