+ Reply to Thread
Results 1 to 6 of 6

Code moved from personal to project issues

  1. #1
    Registered User
    Join Date
    12-11-2014
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    3

    Angry Code moved from personal to project issues

    Hi All,

    Ive been working on some code which mainly retrieves and sorts data for me. I have both code and a userform (with its own code for formatting a combobox and for calling the 'main' macro.

    While I was writing and testing the code I was working in personal.xlsb the code worked fine and I'm all happy with it. however I've tried to move it into the 'project' section on the workbook itself as the code reffers to a spredsheet that is saved in a shared location and used by several people in the office and with the festivities looming I'm planning on being out of the office for a few weeks so wont be around to run the code from my personal.xlsb

    The problem I'm having now is that when I try running the code from the workbook I'm getting errors. For example, in the userform I have a combobox that is pulling dates from a range on the worksheet. The dates appear fine but once I try to select one I get the 'Compile error: Wrong number of arguments or invalid property assignment' error relating to a bit of code that keeps the values in date format (see below)

    Please Login or Register  to view this content.
    Also if i remove this code (that I dont really want to do, not least because I hate not knowing what the issue is) I get the same error in the main body of code that is also formatting data (i.e. formatting text):

    Please Login or Register  to view this content.
    I'm really frustrated as it worked fine before I moved it and have already renamed the macros to avoid VBA getting confused with different macros/procedures with the same name.

    Any help would be really appreciated as I've tried google and had little help there, have had this issue before and not been able to solve it so gave up last time and dont want to do the same again here

    Thanks

    Anna

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Code moved from personal to project issues

    I suspect you have another routine, or object, called Format in that project. If you alter the code to use VBA.Format rather than just Format, does it work? If so, that would confirm my suspicion.
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    12-11-2014
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    3

    Re: Code moved from personal to project issues

    Hi Rory,

    thanks for your quick reply, I dont think I do, but just to confrim I'm understanding you correctly are you proposing the below

    Please Login or Register  to view this content.
    Thanks

    Anna

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Code moved from personal to project issues

    Correct. (you'd also need to change the other code).

  5. #5
    Registered User
    Join Date
    12-11-2014
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    3

    Re: Code moved from personal to project issues

    Hi Rory,

    that worked a charm, thanks so much for you help. I dont understand what the "vba." actually means, I'm assuming it can be used in other places as well?

    Thanks again, my night in shining armour

    Anna
    xx

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Code moved from personal to project issues

    The Format function is part of the VBA library. If you type 'VBA.' (without the quotes) the Intellisense should provide a dropdown of all the available functions/methods of that library.

    Note: it's not generally considered a good idea to create your own routines with names that are the same as built-in VBA functions for this very reason.

+ 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. Hide Personal.xlsb from Project Window
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-22-2014, 04:16 AM
  2. Personal.XLSB procedure to run in any project
    By jaimie1664 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-25-2010, 11:34 AM
  3. Can’t Find Project on Library, Where's Personal
    By CyberDawg in forum Excel - New Users/Basics
    Replies: 0
    Last Post: 10-07-2009, 01:03 PM
  4. Command Button 1 code in personal VBA Project
    By realniceguy5000 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-09-2008, 12:09 PM
  5. Hide Personal Macro in VBA Project Explorer
    By DavidGold in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-27-2005, 10:05 AM

Tags for this Thread

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