+ Reply to Thread
Results 1 to 9 of 9

compile error on simple End.xldown code

  1. #1
    Forum Contributor
    Join Date
    10-04-2010
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    455

    compile error on simple End.xldown code

    Hi peeps,

    Just trying to recreate one of the examples in the excel bible 2003 during lunch but I'm getting a compile error (expected function or variable) on the following bit of code and can't seem to figure out why. The error highlights the "XlDown" portion of the code as erroneous. I copied it straight from the book?

    Please Login or Register  to view this content.
    Last edited by Gti182; 11-23-2010 at 09:07 AM.

  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: compile error on simple End.xldown code

    Works fine, where have you written the code?
    Hope that helps.

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

    Free DataBaseForm example

  3. #3
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    re: compile error on simple End.xldown code

    Just pasted that into a test sub and it compiles fine, as expected. Do you have a sub or module called XLDown?
    Remember what the dormouse said
    Feed your head

  4. #4
    Forum Contributor
    Join Date
    10-04-2010
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    455

    re: compile error on simple End.xldown code

    Just uploaded it in the usual module? I've attached a screenshot of where it's gone wrong.
    Attached Images Attached Images

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

    re: compile error on simple End.xldown code

    Looks like it's in the Sheet module not a standard module

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    re: compile error on simple End.xldown code

    Don't call the sub XLDown!

  7. #7
    Forum Contributor
    Join Date
    10-04-2010
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    455

    Re: compile error on simple End.xldown code

    Ok renamed the sub to "macro1" and that sorted it. Why would the macro name have any influence on the actual code?
    Last edited by Gti182; 11-23-2010 at 09:04 AM.

  8. #8
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: compile error on simple End.xldown code

    You have a routine called XLDown that then refers to XLDown, so the compiler gets confused - it's expecting a constant (or function) to be the argument of the End method, not the name of a subroutine.

  9. #9
    Forum Contributor
    Join Date
    10-04-2010
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    455

    Re: compile error on simple End.xldown code

    cheers for that! Really helpful bit of info there.

+ 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