Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Cheltenham, Gloucestershire, England
    Posts
    214
    Thanks
    0
    Thanked 0 Times in 0 Posts

    activate macro on opening project file (Project 98)

    I have a shared project file where users keep modifying the tables. I have written a macro which open a second file which has copies of out standard entry, tracking and cost tables and then copies them via the organiser to our main project, finally closing the "template2 project down.

    Two things -

    one can I stop getting the messages "do I want to copy the table" in other words the tables are just copied ; and

    two can I make all this happen when I open my project file rather than having to run the macro?

    Sorry my vb knowledge is pretty basic - I can follow instructions but cannot do anything from scratch!

    Thanks

  2. #2
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Cheltenham, Gloucestershire, England
    Posts
    214
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: activate macro on opening project file (Project 98)

    Since posting this I have had a bit of a play (please bear in mind I am not very VB so I hope what I have managed to achieve does not go against the laws of nature!!)

    I created several macros to achieve what I wanted to do (because I kept thinking of bits to improve things!) I copied and pasted all these bits together into one.

    On another forum I found a bit about using

    DisplayAlerts = False

    (this needed to go before the start of the instructions for copying things in the organizer in this case!!.

    Then when examining the project explorer in the VB Editor I found a reference to the project I had open (all the macros had gone into modules). When I selected this low and behold the screen suddenly gave me a Private Sub bit which included the magic word "open". I cut and pasted everything into this and when I open the file if I select disable macros the tables remain as they were when I last closed the file and when I select enable macros the table are all updated to those in my "template" project.

    can anyone please answer two final questions

    - how to stop the screen showing me everything that is happening when the macro is running?
    - how can I delete the modules I don't want in the project explorer (when I select any one the edit menu is empty?)

  3. #3
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts

    Re: activate macro on opening project file (Project 98)

    how to stop the screen showing me everything that is happening when the macro is running?
    -------------
    In Excel the syntax would be:
    <pre>Application.ScreenUpdating =False
    </pre>

    You could try that here.

    - how can I delete the modules I don't want in the project explorer (when I select any one the edit menu is empty?)

    try Right-Clicking on the Module and choosing Remove ModuleName.

    Cheers
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

Posting Permissions

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