+ Reply to Thread
Results 1 to 10 of 10

use of square brackets in vba excel 2003

  1. #1
    Registered User
    Join Date
    01-08-2010
    Location
    toronto, ca
    MS-Off Ver
    Excel 2003
    Posts
    4

    use of square brackets in vba excel 2003

    can someone help me. My code works great on my computer but when I bring it to another computer it gives me errors. I think it has to do with my use of square brackets to reference cells. the error that comes up is

    compile error:
    can't find project or library

    What I'm doin here is going to my template sheet then getting the info from different cells and then later using it somewhere else. in place of using
    range and selecting cell I am using square brackets to select a cell. it worked fine on my computer and was a lot less writing
    here is a small part of my code
    Please Login or Register  to view this content.
    I'm new at excel an using square brackets in this way might be incorrect, but the thing I don't understand is it work awesome on the computer I created the program on

    thanks for any help you give me

    mattsgame
    Last edited by royUK; 01-08-2010 at 02:48 PM. Reason: correct code tags

  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: help with my code

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    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 Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: help with my code

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

  4. #4
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,177

    re: use of square brackets in vba excel 2003

    I think there should be an "frx" file for the macro when exporting and using on other systems. The "frx" file prefix (the name) will be the same as your macro or userform name.
    Example:
    MyMacro.bas
    MyMacro.frx

    Both need to be coppied to the new system.

    HTH
    Regards

    Rick
    Win10, Office 365

  5. #5
    Valued Forum Contributor Richard Schollar's Avatar
    Join Date
    05-23-2006
    Location
    Hampshire UK
    MS-Off Ver
    Excel 2002
    Posts
    1,264

    re: use of square brackets in vba excel 2003

    On the computer where this doesn't work and with this workbook open in Excel, in the VBE go Tools>References and see if anything is listed as MISSING. Report back if so.

    Richard
    Richard Schollar
    Microsoft MVP - Excel

  6. #6
    Registered User
    Join Date
    01-08-2010
    Location
    toronto, ca
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: use of square brackets in vba excel 2003

    in my...
    References - VBAProject
    Available References:
    MISSING:altbutn 1.0 Type Library is Checked


    I'm not sure if this is what you mean so I took a screen Picture and attached it
    Looking at it now I don't know why the Location is C:\Program Files\Kodak easy.......
    Is that the problem? I'll have to look when I get home and see there and why it's located where it is.

    thanks
    Mattsgame
    Attached Images Attached Images
    Last edited by mattsgame; 01-08-2010 at 03:52 PM.

  7. #7
    Valued Forum Contributor Richard Schollar's Avatar
    Join Date
    05-23-2006
    Location
    Hampshire UK
    MS-Off Ver
    Excel 2002
    Posts
    1,264

    Re: use of square brackets in vba excel 2003

    You don't need that reference for your posted code - just uncheck it on this computer and see if your macro now works.

  8. #8
    Registered User
    Join Date
    01-08-2010
    Location
    toronto, ca
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: use of square brackets in vba excel 2003

    Hey hey buddy.. It works .. awesome.. Thank you.
    Why was that like that?
    And if I save it like this will it work on other computers, or do I have to change that each time?

    Thank you very much. Your the man!!

    Mattsgame

  9. #9
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243

    Re: use of square brackets in vba excel 2003

    hi Mattsgame,

    Quote Originally Posted by mattsgame View Post
    ...
    I'm new at excel an using square brackets in this way might be incorrect, but the thing I don't understand is it work awesome on the computer I created the program on.
    ...
    I know Richard has sorted your problem out, but here are a few links which discuss the use of square brackets:
    http://smurfonspreadsheets.wordpress...tting-a-range/
    http://www.decisionmodels.com/calcsecretsh.htm
    (see the "Evaluate Method:" section)
    http://www.ozgrid.com/forum/showthread.php?t=52372

    hth
    Rob
    Rob Brockett
    Kiwi in the UK
    Always learning & the best way to learn is to experience...

  10. #10
    Valued Forum Contributor Richard Schollar's Avatar
    Join Date
    05-23-2006
    Location
    Hampshire UK
    MS-Off Ver
    Excel 2002
    Posts
    1,264

    Re: use of square brackets in vba excel 2003

    Quote Originally Posted by mattsgame View Post
    Hey hey buddy.. It works .. awesome.. Thank you.
    Why was that like that?
    And if I save it like this will it work on other computers, or do I have to change that each time?

    Thank you very much. Your the man!!

    Mattsgame

    As long as you save it without the reference to that altbutn lib file that problem shouldn't re-occur on other computers. I must admit I'm unsure why that reference was present though.

+ 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