+ Reply to Thread
Results 1 to 4 of 4

Add additional functionally to an existing macro

  1. #1
    Registered User
    Join Date
    01-28-2016
    Location
    Stoke, England
    MS-Off Ver
    2016
    Posts
    24

    Add additional functionally to an existing macro

    Hi,
    I’d like to add a macro to extract the data from the mission folder into the excel sheet… I was hoping I could find a way to modify one of the existing macros to this end but it’s too technical for me.
    If you’re interested in helping me out I’ve included sample data and an example of what I am after in the attachment accompanying this post.

    Ok, so I removed the old attachment and set the commandbar’s Temporary argument to true.

    hopefully I’ve done this correctly…


    Sub AddToCellMenu()
    With Application.CommandBars("Cell")
    .Reset
    .Controls.Add(Type:=msoControlButton, Before:=2, Temporary:=True).Caption = "Update Sheet..."
    .Controls("Update Sheet...").OnAction = "LoopAllTxtFilesInFolder"
    End With
    End Sub
    Attached Files Attached Files
    Last edited by JonnyEnglish; 10-22-2016 at 12:57 PM. Reason: removed old attachment

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Add additional functionally to an existing macro

    WARNING: invasive workbook

    Your attachment adds controls to a standard Excel CommandBar (the one you see when you right click a cell). These added controls do not have their Temporary argument set to True.

    I.E. The code in your attached file will alter people's Excel application in a way that will persist after closing the file.

    Cautious responders should open your file with Macro Disabled.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Registered User
    Join Date
    01-28-2016
    Location
    Stoke, England
    MS-Off Ver
    2016
    Posts
    24

    Re: Add additional functionally to an existing macro

    how do i fix that so it's not a problem?

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Add additional functionally to an existing macro

    When you .Add your command bar control, set the Temporary argument to True. That way the control will persist only until the user closes Excel.

+ 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. [SOLVED] Modfication of Existing Code for additional additional cells
    By thilag in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-29-2016, 03:00 AM
  2. [SOLVED] Formula to Add Additional Characters to an existing cell
    By Tamarissa in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-05-2015, 07:00 PM
  3. Additional condition to existing formula
    By pauldaddyadams in forum Excel General
    Replies: 2
    Last Post: 04-09-2015, 08:44 AM
  4. [SOLVED] Add new (additional range) to existing code
    By Blake 7 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-22-2015, 11:43 AM
  5. [SOLVED] need to add additional criteria to existing formula
    By Mattr177 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-31-2014, 12:12 AM
  6. [SOLVED] Adding additional selection criteria to existing Macro
    By Mogpot1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-23-2013, 10:29 AM
  7. additional option to an existing macro
    By Dean England in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-01-2007, 09:46 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