+ Reply to Thread
Results 1 to 14 of 14

corrupted file- result of output of VBA code

  1. #1
    Registered User
    Join Date
    02-06-2012
    Location
    roswell
    MS-Off Ver
    O365
    Posts
    95

    corrupted file- result of output of VBA code

    I have an excel with VBA code that allows users to click a button to save the created report to an normal excel file without all the macros and code.

    They use Excel 2007 and I use Excel 2010- works fine for me- but they get a corruption when they try to reopen the report file. I get a corruption as well when I try to open a file they have created- is there anyway to tell what is causing this corruption?


    Code is:
    Please Login or Register  to view this content.

    Corrupted file is attached
    Last edited by Cutter; 07-16-2012 at 01:44 PM. Reason: Added code tags

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: corrupted file- result of output of VBA code

    There's no attachment.

    You need to specify the FileFormat, so using xlsx, fileformat 51 will save without the code. Switching off DisplayAlerts will stop the warning prompt

    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    02-06-2012
    Location
    roswell
    MS-Off Ver
    O365
    Posts
    95

    Re: corrupted file- result of output of VBA code

    Hi- I added Fileformat 51 to my code - appreciate the help.

    I will see if it resolves the issue

  4. #4
    Registered User
    Join Date
    02-06-2012
    Location
    roswell
    MS-Off Ver
    O365
    Posts
    95

    Re: corrupted file- result of output of VBA code

    They are still claiming issues when they shut the computer down- very weird- will find out tomorrow what is going on i hope

  5. #5
    Registered User
    Join Date
    02-06-2012
    Location
    roswell
    MS-Off Ver
    O365
    Posts
    95

    Re: corrupted file- result of output of VBA code

    Appears there is a known Excel 2010 bug http://social.msdn.microsoft.com/For...e-7748f3c83175

    Suggested fix is
    i had the same issue and within the loop of creating the charts i added a line to activate the chart object which solved the issue.



    Please Login or Register  to view this content.
    Last edited by Paul; 07-17-2012 at 02:23 PM. Reason: Added CODE tags (you can edit posts to add them rather than creating additional posts.)

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: corrupted file- result of output of VBA code

    You need to add Code Tags

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: corrupted file- result of output of VBA code

    Where did exporting charts as gif come from? It wasn't mentioned in your first post

  8. #8
    Registered User
    Join Date
    02-06-2012
    Location
    roswell
    MS-Off Ver
    O365
    Posts
    95

    Re: corrupted file- result of output of VBA code

    Sorry about that

    Appears there is a known Excel 2010 bug http://social.msdn.microsoft.com/For...e-7748f3c83175

    Suggested fix is
    i had the same issue and within the loop of creating the charts i added a line to activate the chart object which solved the issue.


    Please Login or Register  to view this content.
    So my question is how do I modify my code below-
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    02-06-2012
    Location
    roswell
    MS-Off Ver
    O365
    Posts
    95

    Re: corrupted file- result of output of VBA code

    Hi Roy
    No exporting gifs for me- that was the snip form the link that said it was a known bug in Excel.

    I am simply renaming the charts after copying the sheet and want to activate each one as they are renamed to see if ti fixes the corruption issue

  10. #10
    Registered User
    Join Date
    02-06-2012
    Location
    roswell
    MS-Off Ver
    O365
    Posts
    95

    Re: corrupted file- result of output of VBA code

    Would this work?
    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    02-06-2012
    Location
    roswell
    MS-Off Ver
    O365
    Posts
    95

    Re: corrupted file- result of output of VBA code

    Removed- erroneous post
    Last edited by delaneybob; 07-17-2012 at 09:46 PM.

  12. #12
    Registered User
    Join Date
    02-06-2012
    Location
    roswell
    MS-Off Ver
    O365
    Posts
    95

    Re: corrupted file- result of output of VBA code

    Does this address the issue?

    Please Login or Register  to view this content.

  13. #13
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,985

    Re: corrupted file- result of output of VBA code

    Try:
    Please Login or Register  to view this content.
    Everyone who confuses correlation and causation ends up dead.

  14. #14
    Registered User
    Join Date
    02-06-2012
    Location
    roswell
    MS-Off Ver
    O365
    Posts
    95

    Re: corrupted file- result of output of VBA code

    Many thanks for the cleaner code- I will make other changes and work with the person try it tomorrow with the person having the corruption issue, I got dinged for cross posting- i thought the topic had moved to VBA and did not read the rules

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1