Consulting

Page 2 of 2 FirstFirst 1 2
Results 21 to 35 of 35

Thread: Copying macro and associated button to new file/sheet "in flight"

  1. #21
    VBAX Regular
    Joined
    Dec 2007
    Posts
    78
    Location
    cheers...most appreciated

  2. #22
    VBAX Master Norie's Avatar
    Joined
    Jan 2005
    Location
    Stirling, Scotland
    Posts
    1,831
    Location
    drexcel?

    Can you post the URL, or has MrExcel been awarded a doctorate?

  3. #23
    VBAX Contributor CaptRon's Avatar
    Joined
    Mar 2007
    Location
    Austin, Texas
    Posts
    141
    Location
    Open the Control Toolbox Menu (View, Toolbars, Control Box). Then click on the Design Mode icon. Right click on the commandbutton you are wanting to remove and when the option box appears, select Cut.

    Ron
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes.

  4. #24
    VBAX Regular
    Joined
    Dec 2007
    Posts
    78
    Location
    Quote Originally Posted by CaptRon
    Open the Control Toolbox Menu (View, Toolbars, Control Box). Then click on the Design Mode icon. Right click on the commandbutton you are wanting to remove and when the option box appears, select Cut.

    Ron
    Thankyou - another glass ceiling removed.

  5. #25
    VBAX Regular
    Joined
    Dec 2007
    Posts
    78
    Location
    Quote Originally Posted by Norie
    drexcel?

    Can you post the URL, or has MrExcel been awarded a doctorate?
    I promoted him as I was so happy with the service.

  6. #26
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Gosh, does that mean we will be generals soon?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  7. #27
    VBAX Regular
    Joined
    Dec 2007
    Posts
    78
    Location
    Quote Originally Posted by xld
    Gosh, does that mean we will be generals soon?
    If my increasingly pathetic questions keep getting resolved in the way they are at the moment and I'll vote for this forum at the next election.

  8. #28
    VBAX Regular
    Joined
    Dec 2007
    Posts
    78
    Location
    Tee hee, just when I'd thought I had cracked it...

    I have now password protected the VBproject (so that normal users "shouldn't" see the code).

    Of course, when the macro comes to export the code...kablaamm, it can't.

    Must admit, haven't searched extensively yet but (and assuming I don't do this through the userinterface tag as per one of my other threads) how do I unprotect the VBproject using the VB code (and then reprotect it after I've finished exporting)?

  9. #29

  10. #30
    VBAX Master
    Joined
    Jun 2007
    Location
    East Sussex
    Posts
    1,110
    Location
    Question: do you use the Email macro in the original workbook?
    Regards,
    Rory

    Microsoft MVP - Excel

  11. #31
    VBAX Regular
    Joined
    Dec 2007
    Posts
    78
    Location
    Quote Originally Posted by rory
    Question: do you use the Email macro in the original workbook?
    Been thinking along similar lines. I don't need the macro in the original workbook - it's just a convenient place to store and edit.

    Could I just store the email macro in a .bas file outside of Excel?
    Does Excel recognise and open .bas files?

  12. #32
    VBAX Master
    Joined
    Jun 2007
    Location
    East Sussex
    Posts
    1,110
    Location
    I was thinking more of using a template file for your first macro. The template can contain the button and code to run the Email macro. Much easier than fiddling with VBProjects, which assumes access to the Project is trusted.
    Regards,
    Rory

    Microsoft MVP - Excel

  13. #33
    VBAX Regular
    Joined
    Dec 2007
    Posts
    78
    Location
    Maybe thinking too far ahead here, but macro is now in .bas file is my current directory (I can open it in Wordpad).

    Ahem...can I protect it from view?

  14. #34
    VBAX Regular
    Joined
    Dec 2007
    Posts
    78
    Location
    Quote Originally Posted by rory
    I was thinking more of using a template file for your first macro. The template can contain the button and code to run the Email macro. Much easier than fiddling with VBProjects, which assumes access to the Project is trusted.
    Hmm, will have to investigate template files and their affect on the use of the original file (which is a file used for administration).

    Cheers

  15. #35
    VBAX Master
    Joined
    Jun 2007
    Location
    East Sussex
    Posts
    1,110
    Location
    You just create a new file based on the template, populate it with the data (instead of creating a new sheet in your current workbook and populating that), then save it somewhere. You can use Windows security to prevent people viewing any type of file.
    Regards,
    Rory

    Microsoft MVP - Excel

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •