Consulting

Page 2 of 3 FirstFirst 1 2 3 LastLast
Results 21 to 40 of 45

Thread: Solved: Wrote a Macro in Word, now What???

  1. #21
    VBAX Regular
    Joined
    Aug 2004
    Posts
    13
    Location
    MD,

    I am using Word 97 (yeah, nothing like being current). Attached is a print-screen of the code with the error. Thanks!

    Julie

  2. #22
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location

    Code Differences

    Julie,
    You need to click in the border to the left of the code "Sub Autoopen" to insert a breakpoint, then try to open the form. Pressing F8 will step you through each line until an error occurs. As I'm working in 2000, this may be the problem but not insurmountable.
    MD

  3. #23
    VBAX Regular JOrzech's Avatar
    Joined
    Jun 2004
    Location
    Upstate New York
    Posts
    83
    Location

    Julie

    I got some new furniture tonight and had to pick up my son but I'm working on it - it will take a little bit.

    I also think you may need to register your dlls with regserv32.exe. Add them as a reference to your VBA project - it may be comdlg32.dll or something like that... but will explain that once we get you up and running. Maybe someone else here will explain how to register dlls for you... that may be why you get an error message on userform1.show.
    Joanne

  4. #24
    VBAX Master TonyJollans's Avatar
    Joined
    May 2004
    Location
    Norfolk, England
    Posts
    2,291
    Location
    What is the error you get?

    I just took your latest posted example, double clicked on it in Winzip to create a document based on your template in Word 97 under Windows 95 and it worked fine (apart from the form being way too big for the 800*600 screen).
    Enjoy,
    Tony

    ---------------------------------------------------------------
    Give a man a fish and he'll eat for a day.
    Teach him how to fish and he'll sit in a boat and drink beer all day.

    I'm (slowly) building my own site: www.WordArticles.com

  5. #25
    VBAX Regular
    Joined
    Aug 2004
    Posts
    13
    Location
    Tony, MD and Joanne,

    I opened the .zip file this morning and now it is opening fine. I don't know if there was something running in the background that made the computer think the form already was displayed? Who knows! I am still trying to figure out this letterhead/background issue...Thanks again!

    Julie

  6. #26
    VBAX Regular JOrzech's Avatar
    Joined
    Jun 2004
    Location
    Upstate New York
    Posts
    83
    Location
    I worked on the file for quite a while last night... maybe I'm missing something though so please bear with me.

    TonyJollins said the form worked fine for him. But I see no command button so I am at a loss to explain how the form is populated once the user completes the UserForm.

    Julie - can you explain - or is this what your original question was asking? I should have it done tonight if that was the problem but I'm afraid I'm looking a fool - because when I complete the information on the UserForm, I don't know what to do next....

    Thanks.
    Joanne

  7. #27
    VBAX Master TonyJollans's Avatar
    Joined
    May 2004
    Location
    Norfolk, England
    Posts
    2,291
    Location
    Sorry, Joanne. All I meant was it opened automatically so I couldn't see anything wrong with the .Show. I didn't try and do anything with it after it opened.
    Enjoy,
    Tony

    ---------------------------------------------------------------
    Give a man a fish and he'll eat for a day.
    Teach him how to fish and he'll sit in a boat and drink beer all day.

    I'm (slowly) building my own site: www.WordArticles.com

  8. #28
    VBAX Regular JOrzech's Avatar
    Joined
    Jun 2004
    Location
    Upstate New York
    Posts
    83
    Location
    Thanks Tony. I misunderstood.
    Joanne

  9. #29
    VBAX Regular
    Joined
    Aug 2004
    Posts
    13
    Location
    Joanne,

    That's correct...I don't know what to do either. The sales rep can tab through the form over and over and...Anyway, I just need them to be able to print it to give to the customer. Which arises another question. There is no print option. Can I add one?

    What I was asking about a few posts ago is when the file opens, the form opens over another document. I would like to be able just to open the macro form, nothing else. The way it is looks messy. Thanks for all your hard work! I REALLY appreciate it!! :0)

    Julie

  10. #30
    Site Admin
    The Princess VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location
    Julie: Do you realize you've got some of the best Word coders on the web helping you out? (Didn't know if you knew that---soooo cool!!)

    I just wanted to let everyone know that the only thing I've ever heard of where we *hide the application* was this little jobbie from Colo, which hides the Excel interface and even allows the userform to show on the taskbar. Could someone modify it for Word? (I know--I make it sound easy and I'm sure it's not.)

    http://puremis.net/excel/code/063.shtml
    ~Anne Troy

  11. #31
    VBAX Regular JOrzech's Avatar
    Joined
    Jun 2004
    Location
    Upstate New York
    Posts
    83
    Location
    Will do Julie - but it's gonna take a bit of work I'll finish it as soon as I can.
    Joanne

  12. #32
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    H Julie,
    I assume you're looking to print out a document that looks like the Userform, is this correct? If not could you type up a document and post it, so that the printout can be arranged accordingly.
    MD

  13. #33
    VBAX Regular
    Joined
    Aug 2004
    Posts
    13
    Location
    Dreamboat:

    I know I do and I am very grateful for it!! Thanks for the suggestion..

    Joanne:

    Thanks again for all your effort! I will look forward to seeing it...

    MD:

    Yes, something like a print screen would be great (unless there is an easier way to do it).

    Thanks again all!!

    Julie

  14. #34
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location

    Print Form

    Hi Julie,
    I'm looking at somthing like this attachment. Obviously formatting etc. still to be done. Does it function 97? Click to new CommandButton to run.
    MD

  15. #35
    VBAX Master TonyJollans's Avatar
    Joined
    May 2004
    Location
    Norfolk, England
    Posts
    2,291
    Location
    Hi Julie,

    I took a copy of MD's version and merged a version of Colo's code (as posted by Dreamboat) to create the attached. Is this what you want to see?
    Enjoy,
    Tony

    ---------------------------------------------------------------
    Give a man a fish and he'll eat for a day.
    Teach him how to fish and he'll sit in a boat and drink beer all day.

    I'm (slowly) building my own site: www.WordArticles.com

  16. #36
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Hi Tony,
    Thanks for that useful addition. One thing though, I can't get hold of the butterfly to delete/change it. Julie had a letterhead on her original posting, (which I had left off on my sample document) which presumably could act as the "image".
    MD

  17. #37
    VBAX Regular
    Joined
    Aug 2004
    Posts
    13
    Location
    Tony & MD,

    I opened both .zip files and tried to run them. If I just select all the options that have a $$ amount then hit calculate, I get a "Compile Error: Variable not defined" in the "Private Sub CommandAddTotal_Click()" on line "tmp= 0". So, there is no way to get rid of the Word document that is open in the background of the form? When I hit the command button, it takes me to the "background" page. Is this what it is supposed to do? Thanks!!

    Julie

  18. #38
    VBAX Master TonyJollans's Avatar
    Joined
    May 2004
    Location
    Norfolk, England
    Posts
    2,291
    Location
    My fault!

    When I copied Colo's code, it came with an Option Explicit statement at the start and I left it there (the first line in the Form's code module), and didn't think to test the existing code with it.

    Normally you should have this statement but you can delete it temporarily for this early stage of testing and one of us will make sure all the variables are declared later.

    MD,

    I just copied the butterfly as is from Colo's workbook. I'm sure a more relevant image can be found. If you go into Design Mode you can access it.
    Enjoy,
    Tony

    ---------------------------------------------------------------
    Give a man a fish and he'll eat for a day.
    Teach him how to fish and he'll sit in a boat and drink beer all day.

    I'm (slowly) building my own site: www.WordArticles.com

  19. #39
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Design mode!!!

  20. #40
    VBAX Master TonyJollans's Avatar
    Joined
    May 2004
    Location
    Norfolk, England
    Posts
    2,291
    Location
    Click on the set-square icon in the Control Toolbox
    Enjoy,
    Tony

    ---------------------------------------------------------------
    Give a man a fish and he'll eat for a day.
    Teach him how to fish and he'll sit in a boat and drink beer all day.

    I'm (slowly) building my own site: www.WordArticles.com

Posting Permissions

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