Solved

XLSM File corrupting when saving

Posted on 2013-11-06
3
361 Views
Last Modified: 2013-11-11
Hi,

I have a heavy .XLXM file with macros created in Excel 2010. When saving the same file in 2007, it says it has an issue with number of rows and shows the compatibility box. (I checked the rows at this point and it shows 1 million rows compared to 65,000)

When I suppress that and save it, it corrupts the file and the file can never be opened.

The saving is done by macro via this code

   
    ActiveWorkbook.SaveAs Filename:="\\Fileserver\Everyone\CDI " + bName + "\CP Batch Files\" & fName, FileFormat:= _
        xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
        , CreateBackup:=False

Open in new window


What am I doing wrong here? I think above is the culprit (especially the fileformat)

Should I use (xlOpenXMLWorkbookMacroEnabled?)

This never happened to other files.


PS: There is a procedure in the file which saves one of the tab as Excel 2003 version (for uploading into a program) However, this procedure was never triggered. Here is the code that is used in that procedure.

        ActiveWorkbook.SaveAs pName & fName & ".xls", FileFormat:=56

I am includnig this because this code is the only thing that connects anywhere to the row issues excel might have. Everything else is kept as it is.

Any help in right direction is appreciated!
0
Comment
Question by:Shanan212
  • 2
3 Comments
 
LVL 46

Expert Comment

by:Martin Liss
ID: 39628815
I assume that the great majority of the million rows are blank. If that's the case just delete them in 2010 and re-save it.
0
 
LVL 13

Author Comment

by:Shanan212
ID: 39630192
Are you saying just select the rows (lets say from row 10,000 till the million) and delete on every sheet?


Also whats the correct fileformat to save as xlsm (2010) version? What I have highlighted below is correct?

    ActiveWorkbook.SaveAs Filename:="\\Fileserver\Everyone\CDI " + bName + "\CP Batch Files\" & fName, FileFormat:= _
        xlOpenXMLWorkbookMacroEnabled, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
        , CreateBackup:=False
0
 
LVL 46

Accepted Solution

by:
Martin Liss earned 500 total points
ID: 39630279
Yes to both.
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question