+ Reply to Thread
Results 1 to 7 of 7

[Solved]On Click command button function

Hybrid View

Aitchy [Solved]On Click command... 12-02-2010, 07:49 AM
Andy Pope Re: On Click command button... 12-02-2010, 08:14 AM
Aitchy Re: On Click command button... 12-02-2010, 08:21 AM
Andy Pope Re: On Click command button... 12-02-2010, 08:23 AM
Aitchy Re: On Click command button... 12-02-2010, 08:28 AM
Andy Pope Re: On Click command button... 12-02-2010, 08:35 AM
Aitchy Re: On Click command button... 12-02-2010, 08:40 AM
  1. #1
    Registered User
    Join Date
    12-02-2010
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: On Click command button function

    Ah yes sorry, I have changed my attachment.

    Thanks for the code above, but I still get the same error 400 when I click the button and run-time error 13 when stepping through the method.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: On Click command button function

    I do not get a 400 error. I do get a 1004 error if the current directory is not the one with the template file in it.

    Adding the exact folder would help.
        Set NewBook = Workbooks.Open(thisworkbook.path & "\Job Template.xlsm")
    You can no simply step into and through the macro as the Application.Caller value will cause an error.
    You can trap for that

    If IsError(Application.Caller) Then
        MsgBox "Not called via OnAction"
        Exit Sub
    End If
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    12-02-2010
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: On Click command button function

    That was the problem, thank you so much for the help!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1