Thanks Thanks:  0
Likes Likes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: easy macro question

  1. #1
    Board Regular
    Join Date
    Mar 2002
    Posts
    115
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hello, I have been working on my macro storage problem and I have noticed that the problem I was having of my macro button reassigning itself to the latest document based on the template (i.e. it would reassign itself from "template" to "Document1" and if "Document1" was ever deleted, the macro couldn't find the code and wouldn't work) and not staying with the template itself, does not happen if the macro is stored in Personal.xls (I had it in This workbook and I also tried all open workbooks with the same result)

    I would love to understand why this is so, but barring that I would love to know if Personal.xls is an appropriate place to put macros that I need to have be used on other people's computers. I have to email the template out to a few different people, should this work?

    Thanks for any clues! Excel help is hopeless on this subject I'm sorry to say.

    Cheers!

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Your personal macro workbook will remain on your computer.
    You may want to import the module(s) you need into each new workbook created from your template.
    Tom

  3. #3
    Board Regular
    Join Date
    Mar 2002
    Posts
    115
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Testing to see if this posts, my last one didn't.

  4. #4
    Board Regular
    Join Date
    Mar 2002
    Posts
    115
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Jeez I have lost 3 messages so far! Well let me try this one more time...

    I was afraid someone was going to tell me that. The trouble is that when I assign it to "This workbook" or "all open workbooks" The macro button doesn't STAY assigned to the template, it reassigns itself to the last document I used based on the template. So I can send out this worksheet template with the toolbar, but as soon as a party on the other end goes to press the macro button is says it can't find "Document1" or whatever I've called it, which is here on my computer. There must be a way to make it stay with the template so when someone uses it it doesn't have to be reassigned to the template everytime? Sweet Jesus I have looked everywhere for a solution to this and can't find one!!!

    Any other ideas?

  5. #5
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi Snookers...
    I just created a template with a forms button and saved a copy as an Excel Workbook.
    The macro followed and changed it's reference/name automatically...
    The original template was unaffected...
    We're missing something here?
    The only thing I can come up with is you are using a macro from another workbook in your original template.
    Open your original template, right click on your button, choose assign macro. Make sure the macro assigned is in your current template. The filename should precede the macro name. Ex. TemplateTemp1!Button3_Click
    The filename is TemplateTemp1
    The macro name is Button3_Click
    We'll figure it out.
    Tom

    [ This Message was edited by: TsTom on 2002-05-12 20:37 ]

  6. #6
    Board Regular
    Join Date
    Mar 2002
    Posts
    115
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Oh my Goodness, thank yo ufor giving me some hope, even though I still am not understanding where my problem is. Here's what I did to double check everything.

    The Template is named SOSE.xlt
    The Macro is named SOSECutPaste

    I've gone into explorer to open the template and right clicked on the button. Here's what it says:

    SOSE.xlt!SoseCutPaste -- Really good, right?

    Next, Opened Excel>File>New>SOSE Template

    Used the workbook, no worries, saved it to the desktop as TEST, and closed Excel.

    Went back to Excel and File>New>SOSE template
    Right clicked on the macro button (it's on a toolbar that opens and closes with the document - not on a form)and now it's assigned to

    C:WindowsDesktopTEST.xls!SOSECutPaste

    Same thing (obviously) if I go back to explorer and open the template. It's no longer SOSE.xlt!SOSECutPaste but as above.

    Now I can deal with this here cuz I know what to do, but I know it isn't right. Now let's say I delete the TEST.xls document from the desktop and try to use my SOSE template with the macro -- forget it, it's looking for TEST to find the macro and I've deleted it, at far is it thinks, the macro is gone.

    That the h*** is going on? What can I do to trouble shoot this? Do you have any idea where the problem may be?

    Let me know if any ideas I can try. So far everything has failed. Thank you, Lauren

  7. #7
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Someone here will figure this out.
    If you wish, email the file and I will try to duplicate the problem on my sys.
    Tom

    Excel_Create@Earthlink.net

  8. #8
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I followed your steps to the letter...
    Created template1.xlt and saved it in the templates folder...
    Opened Excel, File, New, Template1
    Saved as an Excel Workbook Test.xls to my desktop.
    The macro followed the newly created workbook and when I reopened the template, the macro name was unaffected??
    Eeeeeeeeeeeeek!
    We'll figure it out!!!!
    Tom

  9. #9
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I have your file and it is doing the same thing here as on your comp...
    I'm beginning to waiver, but I'll say it again, We'll figure it out!
    Tom

  10. #10
    Board Regular
    Join Date
    Mar 2002
    Posts
    115
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Ha! I knew I wasn't insane. Maybe what I will do is rewrite the code from scratch and see if that makes any difference. I have to leave work in about 1/2 hour so I may not have time before I go but I will try a test macro from scratch, a short easy one, and see if that works ok.

    Thanks, Mr T!

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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