Consulting

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

Thread: run macros from windows

  1. #21
    VBAX Regular
    Joined
    Apr 2022
    Posts
    13
    Location
    the file(test-db.xlsm) is text file because it has empty code. thank you very much.( with 1 macro)
    Attached Files Attached Files

  2. #22
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,785
    Location
    Quote Originally Posted by mtplmtpl View Post
    I am very grateful to those who help me. wrote about this many times. SamT and Paul Hossler. I spend a lot of time to understand the answer. Now Sorry, I can't because I can't find the icon in the forum (I found how to download a photo and a picture, but not a file). excuse me. i try

    Glad it worked. To attach a file the next time, write your text then ...

    1. Click [Go Advanced] below and to the right
    2. Click the 'Paperclip' icon
    3. Click [Add Files]
    4. Click [Choose File]
    5. Browse to the file to upload
    6. Select the file, click [Open]
    7. Click [Upload] on the Add Files dialog

    Capture.JPGCapture1.JPGCapture2.JPG

    Some annoyances I find --

    1. You can only add one file at a time, no multiselect
    2. Some file types cannot be uploaded
    3. There is a reasonable (?) limit on file size
    4. You can [Insert Inline] like the screenshots above or [Done] to have them in the [Attached Files] area

    Capture4.JPG
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  3. #23
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,785
    Location
    1. I don't understand your comment

    Quote Originally Posted by mtplmtpl View Post
    the file(test-db.xlsm) is text file because it has empty code. thank you very much.( with 1 macro)


    2. I don't understand your overall intent

    I am working with userform for the first time. I made a macro text3 (there is this code in module1), created a form userform1, with one click button, I can't run my macros text3 from this form. By clicking on the run button, I automatically get to a module. There I see two sub... end sub. It is necessary to write code inside of the module. I don't know what exactly. Similarly with another form, it is necessary to reflect the message from msgbox on it. Help

    3. Go back and read Post #14

    but how to run from windows explorer? after than I will use your code. exactly- user clicks on the address of file in windows and he see form1 on his computer. thank you and sorry


    4. Just save the attached XLSM and then double click it. Look at code in ThisWorkbook module, UserFOrm1, and Module1

    Capture.JPG
    Attached Files Attached Files
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  4. #24
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,232
    Location
    @mtplmtpl. the file you uploaded is meaningless. Where is the file you talked about in your initial post? Did you look at the example (Demo.xlsm) the Paul_Hossler kindly provided for you?

    I seriously doubt that you did for if you had done so you will have seen a perfectly good example of a workbook upon opening loading a Userform1 and only showing the Userform. On that Userform is a Command Button which when clicked "calls" the Sub Hello module which simply displays a message "Hello!!".

    If you haven't do so by now I request that you pause here and do so by saving Paul's file to your system, locate the file by using File Explorer, Double click on the file Demo.xlsm and click on the Command Button that is embedded on the Userform. This example does everything you asked for. When you are ready to try to understand the structure of the workbook, select Developer section ( Alt F11 in Microsoft systems I believe). The workbook contains a Userform1 and three modules. If you click on THisworkbook you will find the 1st, click on Userform1 to find the second, Click on Module1 to find the third.

    Screen Shot 2022-05-01 at 10.24.24 am.jpg
    Click on Thisworkbook to find the 1st module. It is this module which upon the workbook opening, loads and shows the Userform1.


    Screen Shot 2022-05-01 at 10.26.26 am.jpg


    Click on UserForm1 to find the second module, in which the command button function calls the Sub Hello()

    Screen Shot 2022-05-01 at 10.24.47 am.jpg


    Click on Module 1 to find the 3 section of code, namely the Sub Hello()

    Screen Shot 2022-05-01 at 10.25.07 am.jpg

    Once you have done this you should now understand where to place your sections of code, how to construct them, and the reasoning behind the structure.

    In your very first post you talked about having constructed a Userform and a macro. Unless you are prepared to upload the workbook upon which you are attempting to design your Userform, we are very limited in giving you precise assistance.
    Last edited by Aussiebear; 04-30-2022 at 05:50 PM. Reason: Uploaded wrong screen shot
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  5. #25
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,785
    Location
    @AussieBear -- roger that

    @mtplmtpl -- I tried to make sense of your second file - text-db - and guessed at some things that might give you the idea about how to structure your workbook since the other suggestions from myself, Aussiebear and other did not seem to take

    Hopefully, you can relate better to test-db and see where things need to go. Save it somewhere you can find it and then double-click the XLSM file in Explorer

    Other than that, I'm out of ideas
    Last edited by Paul_Hossler; 05-01-2022 at 07:37 AM.
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  6. #26
    VBAX Regular
    Joined
    Apr 2022
    Posts
    13
    Location
    Dear admin and Paul. Everything works very good according to your recommendations. thank you very much and sorry

Posting Permissions

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