Consulting

Results 1 to 5 of 5

Thread: Solved: Force users to enable macros

  1. #1

    Solved: Force users to enable macros

    Hi,
    I was using the code given in the KB entry http://vbaexpress.com/kb/getarticle.php?kb_id=578

    I'm getting a Run time error' 1004 - Method 'Goto' of object appreciation failed message.
    It seems to be an error in the line

    Application.Goto Worksheets(1).[A1], True '< Optional

    Can you anyone help.. i've given the error screenshot and also the working file as an attachment..

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Change that line to

    [vba]

    Application.Goto Worksheets(2).[A1], True '< Optional
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    This works fine now.
    can you explain me what this code meant for?

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    The idea is to invoke the first visible sheet if macros are enabled, but for you the first visible sheet is sheet 2 not sheet 1.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    Thank you so much.

Posting Permissions

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