+ Reply to Thread
Results 1 to 6 of 6

Excel Error Message upon opening of Excel file

  1. #1
    Registered User
    Join Date
    11-22-2019
    Location
    Dublin, Ireland
    MS-Off Ver
    MS Office 365 Pro Plus
    Posts
    7

    Excel Error Message upon opening of Excel file

    Hi

    I have created a macro to populate the Premiership table with a variety of statistics. However, after running the macro, whenever I open the excel file, I get the following Error Message:

    Error1.PNG
    Error2.PNG

    Does anybody know what this means and how I can fix it?

    Thank you
    Last edited by rhorgan; 11-25-2019 at 08:20 AM. Reason: Problem solved

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,908

    Re: Excel Error Message upon opening of Excel file

    It means your macro does something wrong when applying a sort. Usually it's that you forgot to clear the existing sortfields before adding new ones, but it would be easier to be sure if we could actually see the code...
    Rory

  3. #3
    Registered User
    Join Date
    11-22-2019
    Location
    Dublin, Ireland
    MS-Off Ver
    MS Office 365 Pro Plus
    Posts
    7

    Re: Excel Error Message upon opening of Excel file

    Quote Originally Posted by rorya View Post
    It means your macro does something wrong when applying a sort. Usually it's that you forgot to clear the existing sortfields before adding new ones, but it would be easier to be sure if we could actually see the code...
    Ah ok, I'm only new to VBA, so I'm just learning as I go along. The code is written to sort the teams on the basis of points, and if the points are equal then goal difference, and if both are equal then it sorts by goals for. This is the part of the code with the sort:

    Please Login or Register  to view this content.
    Last edited by Pepe Le Mokko; 11-22-2019 at 12:03 PM. Reason: Code tags

  4. #4
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,908

    Re: Excel Error Message upon opening of Excel file

    Yep, you need to add:

    Please Login or Register  to view this content.
    before each of the three .Sortfields.Add... lines.

  5. #5
    Registered User
    Join Date
    11-22-2019
    Location
    Dublin, Ireland
    MS-Off Ver
    MS Office 365 Pro Plus
    Posts
    7

    Re: Excel Error Message upon opening of Excel file

    Quote Originally Posted by rorya View Post
    Yep, you need to add:

    Please Login or Register  to view this content.
    before each of the three .Sortfields.Add... lines.
    Amazing, that solved it! Thanks so much

  6. #6
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Excel Error Message upon opening of Excel file

    @rhorgan
    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    I did it for you this time. Please read forum rules. Thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Error Message when opening excel file
    By Wbdavisg01 in forum Excel General
    Replies: 2
    Last Post: 12-13-2018, 07:02 PM
  2. [SOLVED] Error message when first opening Excel
    By zookeepertx in forum Excel General
    Replies: 5
    Last Post: 10-24-2018, 11:57 AM
  3. Error Message while opening Excel-File
    By Carteloni in forum Excel General
    Replies: 3
    Last Post: 12-06-2014, 02:26 PM
  4. [SOLVED] Error message when opening 2013 Excel in a Mac
    By mtndewgradon in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 2
    Last Post: 11-06-2013, 02:37 PM
  5. Replies: 2
    Last Post: 10-15-2005, 10:05 AM
  6. [SOLVED] Error Message When Opening Excel
    By Walid in forum Excel General
    Replies: 2
    Last Post: 07-27-2005, 05:05 PM
  7. Error message opening Excel
    By Ed in forum Excel General
    Replies: 1
    Last Post: 03-18-2005, 12:06 AM

Tags for this Thread

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