+ Reply to Thread
Results 1 to 7 of 7

Changing VBA Project Name Using VBA Code

Hybrid View

PosseJohn Changing VBA Project Name... 01-06-2016, 01:45 PM
6StringJazzer Re: Changing VBA Project Name... 01-06-2016, 02:40 PM
Leith Ross Re: Changing VBA Project Name... 01-06-2016, 03:10 PM
PosseJohn Re: Changing VBA Project Name... 01-06-2016, 03:57 PM
Leith Ross Re: Changing VBA Project Name... 01-06-2016, 04:20 PM
PosseJohn Re: Changing VBA Project Name... 01-06-2016, 05:08 PM
Leith Ross Re: Changing VBA Project Name... 01-06-2016, 06:11 PM
  1. #1
    Forum Contributor
    Join Date
    10-25-2010
    Location
    Phoenix, Arizona, USA
    MS-Off Ver
    O365
    Posts
    202

    Changing VBA Project Name Using VBA Code

    I have a project which has the VBA Project Properties as follows:
    Project Name...............ChemistryUnit1
    Project Description.......Chemistry U1 Morning Report Generator
    In the project, I have a variable that can change the Unit from 1 to 15.

    I would like to automate the updating of the Project Properties using VBA code from within the same project, instead of manually updating the properties each time.

    I have never modified VBA from within itself, I need help please.

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

    Re: Changing VBA Project Name Using VBA Code

    What application are you talking about? Excel doesn't have any "project" properties. Is this a Microsoft Project question? Please be specific about where you can see the Project Name and Project Description and how you are accessing them in VBA code.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Changing VBA Project Name Using VBA Code

    Hello PosseJohn,

    You can change the VBA Project Description at runtime but not the project Name.

    Change the PVBA Project Name
        ThisWorkbook.VBProject.Description = "Chemistry U2 Morning Report Generator"
    I believe the VBA Project Name can only be changed during Design time.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Forum Contributor
    Join Date
    10-25-2010
    Location
    Phoenix, Arizona, USA
    MS-Off Ver
    O365
    Posts
    202

    Re: Changing VBA Project Name Using VBA Code

    I am in the project currently.

    I have tried
    MsgBox ThisWorkbook.VBProject.Description
    MsgBox ThisWorkbook.VBProject.Name
    Neither statement functions.

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Changing VBA Project Name Using VBA Code

    Hello PosseJohn,

    Has the workbook been saved?

  6. #6
    Forum Contributor
    Join Date
    10-25-2010
    Location
    Phoenix, Arizona, USA
    MS-Off Ver
    O365
    Posts
    202

    Re: Changing VBA Project Name Using VBA Code

    Leith,

    Yes, the WB has been saved. I receive the following error message:
    Programmatic access to Visual Basic Project is not trusted

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Changing VBA Project Name Using VBA Code

    Hello PosseJohn,

    You will need to change your Trust Center settings to allow access to the VBA Project.

    View my options and settings in the Trust Center

+ 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. Changing dates in excel based project plan
    By MATEJASIMIC in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-04-2014, 07:48 AM
  2. [SOLVED] hELP FOR MY PROJECT (IN PROJECT SHEET CODE NOT WORK,, OUTSIDE THAT CODE WORK)
    By santosh226001 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 08-06-2013, 06:53 AM
  3. [SOLVED] Function that concatenates multiple sub-project descriptions based on project code
    By markbpi in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-28-2012, 06:49 PM
  4. Need help on VBA code for school project!
    By rollintide89 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-04-2011, 06:38 AM
  5. Help w/VBA code for project.
    By iThinkDeeply in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-04-2010, 01:00 PM
  6. If i entered any project code in sheet2 display all data of that project
    By koolguys4u in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-21-2009, 03:09 AM
  7. Protect VBE Project using code
    By jman0707 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-31-2009, 02:26 PM

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