Solved

XLSM File corrupting when saving

Posted on 2013-11-06
3
373 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 47

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 47

Accepted Solution

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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
My experience with Windows 10 over a one year period and suggestions for smooth operation
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

685 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