+ Reply to Thread
Results 1 to 20 of 20

Help with - "Ambigious name detected" - mulitple codes on sheet.

  1. #1
    Forum Contributor
    Join Date
    11-02-2011
    Location
    Rugby, England
    MS-Off Ver
    Office 365
    Posts
    884

    Help with - "Ambigious name detected" - mulitple codes on sheet.

    Good morning happy campers.

    I have the following codes set in a workbook.
    This Workbook -
    Please Login or Register  to view this content.
    Module 1
    Please Login or Register  to view this content.
    Module 2
    Please Login or Register  to view this content.
    So far, when the work book is shared (allowing changes by more than one user) it appears to work fine, updating/refreshing the values every 30 seconds and then saving every 5 minutes.
    The problem comes when closing the worksheet, i have the following error - "Complie Error: Ambigious name detected; ~"
    Which highlights the following line in yellow -
    Please Login or Register  to view this content.
    If i simply close the debugger then excel asks me if i want to save, i click yes, it saves and closes, job done.
    What i would like to know is is the error going to casue me an issue, and either way, how do i prevent it?
    I cant post work book yet as i would need to strip all data out of it, but the data inside the sheet is all manual entry with very few formula's, basically the code doesnt modify anything inside the sheet apart from updating values.

    Kind Regards.
    galvinpaddy
    Last edited by galvinpaddy; 06-21-2012 at 02:44 AM.

  2. #2
    Forum Contributor
    Join Date
    11-02-2011
    Location
    Rugby, England
    MS-Off Ver
    Office 365
    Posts
    884

    Re: Help with - "Ambigious name detected" - mulitple codes on sheet.

    Good morning happy campers,

    Would really like some help in resolving this

    regards, galvinpaddy

  3. #3
    Forum Contributor
    Join Date
    01-20-2012
    Location
    Amsterdam, The Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    186

    Re: Help with - "Ambigious name detected" - mulitple codes on sheet.

    Hi Galvinpaddy,

    Can you give it a try without these rows in module2?

    Please Login or Register  to view this content.
    Looks like some double public declarations

  4. #4
    Forum Contributor
    Join Date
    11-02-2011
    Location
    Rugby, England
    MS-Off Ver
    Office 365
    Posts
    884

    Re: Help with - "Ambigious name detected" - mulitple codes on sheet.

    Hi, thanks for that!!!
    BUT -
    Whilst i no longer receive that error, Now, when the workbook is shared the changes dont update from another user.
    I think i may have added a wrong sectiopn of code though -
    Please Login or Register  to view this content.
    should this be
    Please Login or Register  to view this content.
    ??

  5. #5
    Forum Contributor
    Join Date
    11-02-2011
    Location
    Rugby, England
    MS-Off Ver
    Office 365
    Posts
    884

    Re: Help with - "Ambigious name detected" - mulitple codes on sheet.

    hhhmmmm, i changed my code to read -
    Please Login or Register  to view this content.
    And now receive Run-time error '1004': Method of object '_Workbook' failed.
    The sheet is not protected it is only shared.

  6. #6
    Forum Contributor
    Join Date
    01-20-2012
    Location
    Amsterdam, The Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    186

    Re: Help with - "Ambigious name detected" - mulitple codes on sheet.

    Hi Galvinpaddy,

    Check this tread: http://www.excelforum.com/excel-gene...-question.html

    Regards,
    Rkey

  7. #7
    Forum Contributor
    Join Date
    11-02-2011
    Location
    Rugby, England
    MS-Off Ver
    Office 365
    Posts
    884

    Re: Help with - "Ambigious name detected" - mulitple codes on sheet.

    ?? lol, no link in your post :D

  8. #8
    Forum Contributor
    Join Date
    01-20-2012
    Location
    Amsterdam, The Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    186

    Re: Help with - "Ambigious name detected" - mulitple codes on sheet.

    Got fat fingers, hitted the enter :P

  9. #9
    Forum Contributor
    Join Date
    11-02-2011
    Location
    Rugby, England
    MS-Off Ver
    Office 365
    Posts
    884

    Re: Help with - "Ambigious name detected" - mulitple codes on sheet.

    hehehe
    ok, so from their i get
    Please Login or Register  to view this content.
    But how does this fit in with my code??

  10. #10
    Forum Contributor
    Join Date
    01-20-2012
    Location
    Amsterdam, The Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    186

    Re: Help with - "Ambigious name detected" - mulitple codes on sheet.

    I'm on a curve here as well.
    I read a lot of disregards towards sharing a book :P.
    However, i just came across this one.
    Can you try this?

    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    11-02-2011
    Location
    Rugby, England
    MS-Off Ver
    Office 365
    Posts
    884

    Re: Help with - "Ambigious name detected" - mulitple codes on sheet.

    lots of curves around shared books as far as i can see lol

    That code does save the sheet but does not appear to update changes made by others

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

    Re: Help with - "Ambigious name detected" - mulitple codes on sheet.

    You are declaring your variables as Public, so you have identical variables because you repeat it in two modules.
    Hope that helps.

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

    Free DataBaseForm example

  13. #13
    Forum Contributor
    Join Date
    11-02-2011
    Location
    Rugby, England
    MS-Off Ver
    Office 365
    Posts
    884

    Re: Help with - "Ambigious name detected" - mulitple codes on sheet.

    Hi RoyUK,
    Thanks for that, would you be kind enough to 'repair' my coding?

    regards

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

    Re: Help with - "Ambigious name detected" - mulitple codes on sheet.

    attach the file

  15. #15
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Help with - "Ambigious name detected" - mulitple codes on sheet.

    Hi Richard
    This is code I use for timer events. I don't know from shared workbooks...not certain what the code will do in that regard. Replace your code with this code. Let me know of issues.

    In ThisWorkbook Module
    Please Login or Register  to view this content.
    In a General Module
    Please Login or Register  to view this content.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  16. #16
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Help with - "Ambigious name detected" - mulitple codes on sheet.

    Hi Richard
    Been playing with shared workbooks...change this code...it appears to perform as expected
    Please Login or Register  to view this content.

  17. #17
    Forum Contributor
    Join Date
    11-02-2011
    Location
    Rugby, England
    MS-Off Ver
    Office 365
    Posts
    884

    Re: Help with - "Ambigious name detected" - mulitple codes on sheet.

    Good morning John,

    Having made the following changes:
    THIS WORKBOOK
    Please Login or Register  to view this content.
    MODULE1
    Please Login or Register  to view this content.
    Once shared & saved, the following error comes up - "Run-time error '1004': Method 'RefreshAll' of object '_Workbook' failed. i cant debug (as its shared) to show you what is highlighted.

    Please advise.
    Kind Regards, galvinpaddy

  18. #18
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Help with - "Ambigious name detected" - mulitple codes on sheet.

    Hi Richard
    Comment out this line of code
    Please Login or Register  to view this content.

  19. #19
    Forum Contributor
    Join Date
    11-02-2011
    Location
    Rugby, England
    MS-Off Ver
    Office 365
    Posts
    884

    Re: Help with - "Ambigious name detected" - mulitple codes on sheet.

    John, you sir are a legend yet again.

    So many thanks indeed.

  20. #20
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Help with - "Ambigious name detected" - mulitple codes on sheet.

    You're welcome...glad I could help.

+ 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