Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

XLSM File corrupting when saving

Posted on 2013-11-06
3
Medium Priority
?
381 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 49

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 49

Accepted Solution

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

Featured Post

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
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 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.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

721 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