Solved

XLSM File corrupting when saving

Posted on 2013-11-06
3
379 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 48

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 48

Accepted Solution

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

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
Outlook for dependable use in a very small business   This article is about using the Outlook application (part of Microsoft Office) in a very small business, or for homeowners where dependability and reliability are critical requirements. This …
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

623 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