+ Reply to Thread
Results 1 to 9 of 9

dictionary as public must calling

  1. #1
    Valued Forum Contributor
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,356

    dictionary as public must calling

    I have coding i am store data as dictionary
    Please Login or Register  to view this content.
    When dictionary using in sub makro
    This bellow is error
    Please Login or Register  to view this content.
    But if using call mydic ,that will be sucses
    Please Login or Register  to view this content.
    Last edited by 6StringJazzer; 02-12-2018 at 10:52 AM. Reason: removed incorrect characters from title

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: „dictionary as public must calling„

    You have syntax errors in the code you have posted so it won't compile. This suggests that you just typed the code into your post, so there could be other errors. We need to see the actual code that you are running.

    When posting code, first compile the code, then copy the code from the VBA window and paste it into your post so we have a valid starting point.

    This bellow is error
    Please explain what "is error" means.
    • Does the code run?
    • Does it run but do nothing?
    • Does it produce error messages? If so, what do the messages say?
    • Does it produce unexpected/wrong results? If so, how do the results differ from what you expect?
    • Does it hang?
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,098

    Re: dictionary as public must calling

    Along with what 6StringJazzer has said, if your code is in separate modules you'll need to change your Dim Statement to
    Please Login or Register  to view this content.

  4. #4
    Valued Forum Contributor
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,356

    Re: dictionary as public must calling

    I has do also as public
    But when run in other macro must calling
    mydic

  5. #5
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: dictionary as public must calling

    Also if you want to use dic without calling it first (you need to fill the dictionary) you should put your first code in ThisWorkbook. Especially in workbook.open so it gets filled on startup.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  6. #6
    Valued Forum Contributor
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,356

    Re: dictionary as public must calling

    Yes i has do to
    But if dictionary has change data value before workbook.close then its also must open Wb again

  7. #7
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: dictionary as public must calling

    You can work on dic as normal.
    Try this as test.
    Put this in standard module.
    Please Login or Register  to view this content.
    Put this in Thisworkbook
    Please Login or Register  to view this content.
    Run workbook_open first, then sub tst
    Then

  8. #8
    Valued Forum Contributor
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,356

    Re: dictionary as public must calling

    If using workbook.open
    Same as call mydic in sub makro

  9. #9
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: dictionary as public must calling

    I should have explained myself better.
    Put both codes in workbook. Save and Close.
    Reopen so Workbook_open runs automatically. You just need to run tst.

+ 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. Dictionary as public
    By daboho in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-20-2017, 02:51 PM
  2. Bad Syntax for calling public variables
    By lordterrin in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-04-2013, 04:24 PM
  3. Calling a Public Loop
    By justforthis1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-08-2012, 02:56 PM
  4. Calling a public function from userform
    By BBQNJL in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-09-2009, 05:38 PM
  5. Calling a DLL from Excel.:public domain
    By Jim15 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-02-2007, 02:40 PM
  6. Calling a Public Subroutine in a Different Workbook
    By Raul in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-24-2005, 12:05 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