Page 1 of 2 12 LastLast
Results 1 to 15 of 26
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Open at Specific Sheet (Excel 2002 SP2)

    Hi

    I have several spreadsheets that open to an Index worksheet, using vba as screenshot, but this one particular Workbook throw up the following error.
    runtime error 2147319784(80028018)
    Method select Object_Worksheet failed

    I don't understand why!! can anyone help please.

    Thanks Braddy
    If you are a fool at forty, you will always be a fool

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Open at Specific Sheet (Excel 2002 SP2)

    Is "index" a hidden sheet?

    Steve

  3. #3
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: Open at Specific Sheet (Excel 2002 SP2)

    Hi

    Steve no it's not hidden

    Braddy
    If you are a fool at forty, you will always be a fool

  4. #4
    5 Star Lounger
    Join Date
    Dec 2000
    Location
    Reading/Swindon, Berkshire, United Kingdom
    Posts
    664
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Open at Specific Sheet (Excel 2002 SP2)

    I think it's because "Index" is a reserved word in vba, though I may be wrong....


    Edited Later:

    It seems I'm wrong after all <img src=/S/blush.gif border=0 alt=blush width=15 height=15> I just actually tried it and it works fine for me.

  5. #5
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: Open at Specific Sheet (Excel 2002 SP2)

    Hi Brooke

    Yes you can use index I have used it more than once.

    Thanks

    Braddy
    If you are a fool at forty, you will always be a fool

  6. #6
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Open at Specific Sheet (Excel 2002 SP2)

    Do you have a case error? "index" should be "Index"?
    -John ... I float in liquid gardens
    UTC -7ąDS

  7. #7
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: Open at Specific Sheet (Excel 2002 SP2)

    <img src=/S/hello.gif border=0 alt=hello width=25 height=29> Braddy

    Why not use <font color=blue>Foglio1</font color=blue> instead of "Index"?

    You named the object for a reason, so why not get the most "Bang" <img src=/S/blackhole.gif border=0 alt=blackhole width=15 height=15> for your "Buck" <img src=/S/money.gif border=0 alt=money width=17 height=15>?

    Foglio1 is <font color=red>NOT</font color=red> a key word, at least not in the American version of MS-Excel 2002.

    Alternativly, you may need to give Excel a breathing space by not putting your code in the Workbook Open event. Maybe put the Worksheet....Open line in a module and call that module from the Open event.

    This is from Excel 5.x and I am sure that it still is here since that time. Trust me as far as you can throw me, but it might make things work.


    Wassim
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  8. #8
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Dallas plus 20 miles or so, Texas, USA
    Posts
    876
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Open at Specific Sheet (Excel 2002 SP2)

    You might also try "ThisWorkbook.Worksheets("Index").Select.

  9. #9
    5 Star Lounger
    Join Date
    Dec 2000
    Location
    Reading/Swindon, Berkshire, United Kingdom
    Posts
    664
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Open at Specific Sheet (Excel 2002 SP2)

    when I actuallly tried it, that was my second thought - but case didn't seem to matter either.

  10. #10
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: Open at Specific Sheet (Excel 2002 SP2)

    Hi John

    I've tried both

    I've even tried renaming the sheet

    Thanks Braddy
    If you are a fool at forty, you will always be a fool

  11. #11
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: Open at Specific Sheet (Excel 2002 SP2)

    Hi

    I've tried to use the Italian foglio 1 but it still does not work.

    I''m afraid I am not skilled enough to understand the second part of your reply.

    Thanks

    Braddy
    If you are a fool at forty, you will always be a fool

  12. #12
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: Open at Specific Sheet (Excel 2002 SP2)

    Hi Michael

    I tried your suggestion and it gave me a syntax error

    Thanks

    Braddy
    If you are a fool at forty, you will always be a fool

  13. #13
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Open at Specific Sheet (Excel 2002 SP2)

    Your experience make me suspect that your workbook is corrupt. The code in itself is OK, and as you wrote, it works without problems in other workbooks.

    What happens if you save the workbook as a HTML (File | Save as Web Page...), then save it as a .xls workbook again?

  14. #14
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: Open at Specific Sheet (Excel 2002 SP2)

    Hi Hans

    I did as you suggested and it is still the same, but thanks anyway.

    As I have always been successful with this command before I will assume you are correct about corruption and put this thread to bed.

    Thanks for everyones assistance.

    Braddy
    If you are a fool at forty, you will always be a fool

  15. #15
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Open at Specific Sheet (Excel 2002 SP2)

    Since foglio1 is an object, the correct syntax would be:

    <pre> foglio1.select
    </pre>

    Legare Coleman

Page 1 of 2 12 LastLast

Posting Permissions

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