+ Reply to Thread
Results 1 to 7 of 7

Ignoring an expected compile error

  1. #1
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    1,957

    Ignoring an expected compile error

    HI,
    I have an addin which is distributed to a number of users. All users have 32bit office but some of them use Office 2007 and others use Office 365.

    My addin contains an number of UDFs and I use the application.macrooptions method to add descriptions of the function and arguments.

    The problem is that Office 2007 doesn't support the arguments and gives a compile error.
    I don't want to remove these as they work fine in O365, so is there anyway I can ignore that error?

    I've already tried checking the application version and On Error Resume Next, but this is probably too late to catch the compilation.

  2. #2
    Valued Forum Contributor ranman256's Avatar
    Join Date
    07-29-2012
    Location
    Kentucky
    MS-Off Ver
    Excel 2003
    Posts
    1,176

    Re: Ignoring an expected compile error

    can you alter the code and add:
    on error resume next

    if not try the excel command to turn off error msgs:
    Application.DisplayAlerts = false

  3. #3
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,618

    Re: Ignoring an expected compile error

    I think the conditional compilation could help.
    Use VBA6 for Excel 2007 version

    see https://docs.microsoft.com/pl-pl/off...iler-constants
    Best Regards,

    Kaper

  4. #4
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    1,957

    Re: Ignoring an expected compile error

    Hi All,

    I'm still having this issue. I've tried Resume Next and checking the version but the error occurs before anything is executed.

    I have quite a few UDFs which are proceesed by this routine which is called from the Addin_Install event.
    In later version of Excel it's fine, but in earlier versions "ArgumentDescriptions" is not supported and produces a compile error during the install.
    There isn't any loss of functionality other than the absence of argument descriptions, so I'd like be able to suppress/ignore the compile error.

    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    1,957

    Re: Ignoring an expected compile error

    I solved this. It was just a case of having a conditional compliation:
    Please Login or Register  to view this content.

  6. #6
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,618

    Re: Ignoring an expected compile error

    Seems my advice from #3, 3 months ago was right. The code above is (I think) equivalent to:
    Please Login or Register  to view this content.
    or
    Please Login or Register  to view this content.

  7. #7
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    1,957

    Re: Ignoring an expected compile error

    Yes it was, thank you!
    Unfortunately I didn't check back here until recently - could have saved a lot of time if I had.

+ 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. [SOLVED] compile error expected: (
    By kevinu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-27-2018, 03:10 AM
  2. [SOLVED] Compile error: Expected end with???
    By OpOrange in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-22-2014, 08:27 AM
  3. Compile error: Expected End Sub
    By MacroCoder in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-06-2013, 04:05 PM
  4. Compile Error: Expected End With
    By Robert110 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-14-2013, 07:14 AM
  5. Compile Error: Expected End Sub
    By Dcauth in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-31-2011, 01:56 PM
  6. Compile error: Expected End Sub
    By Leeboy in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-31-2011, 09:44 AM
  7. Compile Error: Expected End Sub
    By Lothar69 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-27-2011, 10:55 AM

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