+ Reply to Thread
Results 1 to 5 of 5

How can I write a macro to "click" a button

Hybrid View

  1. #1
    Registered User
    Join Date
    06-08-2012
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    11

    How can I write a macro to "click" a button

    I would like to write a macro that will "click" export (XML Map on developer tab).

    When I try to record a macro, excel gives me this:

    
    ActiveWorkbook.XmlMaps("MY_Map").Export URL:= _
            "C:\PATH\FILE.xml"
    which of course just brings back errors. How can a I do this, so that the next person to use this (who doesn't have the developer tab) can just click my little button??

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: How can I write a macro to "click" a button

    probably just
    application.commandbars.executemso "XmlExport"
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Registered User
    Join Date
    06-08-2012
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: How can I write a macro to "click" a button

    Beautiful, cheers mate!

    One thing tho is it possible to give it a filename?

    The script will: export the xml, then convert it to UTF-8 for use in a flash app. If I can avoid the user being given a chance to change anything would be great!

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: How can I write a macro to "click" a button

    you'd need code like you had originally for that. the commandbars code is the literal equivalent of clicking the button.

  5. #5
    Registered User
    Join Date
    06-08-2012
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: How can I write a macro to "click" a button

    It will do for now, thanks for your 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