+ Reply to Thread
Results 1 to 12 of 12

How to call a click button which is on another spread sheet in your MACRO

  1. #1
    Registered User
    Join Date
    03-25-2013
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    26

    How to call a click button which is on another spread sheet in your MACRO

    Hi All,

    Sorry, a very noob question here.

    My macro for spead sheet called test0

    1) Open a different spead sheet ( test1 )

    2) Click the relevent sheet (sheet1)

    3) Press a button which is on the spead sheet ( on test1 )

    4) Save as test1 as test_final.

    Macro does not record me clicking that button !

    I don't know how else can this be done. I don't know if this can be done or not ! sorry if i didn't explain it properly

    Thank you for your help in advance - ta
    Last edited by kbriaz; 08-02-2013 at 06:32 AM.

  2. #2
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: How to call a click button which is on another spread sheet in your MACRO

    Can you please post the recorded macro..
    Regards!
    =DEC2HEX(3563)

    If you like someone's answer, click the star to give them a reputation point for that answer...

  3. #3
    Registered User
    Join Date
    03-25-2013
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: How to call a click button which is on another spread sheet in your MACRO

    Sub New_Q_ALL()
    '
    ' New_Q_ALL Macro
    '

    '
    Workbooks.Open Filename:= _
    "K:\A & A\test1.xlsm"
    Windows("test1.xlsm").Activate
    Sheets("sheet1").Select
    Application.Run RefreshData_Adhoc
    ActiveWorkbook.SaveAs Filename:= _
    "K:\A & A\test_final.xlsx" _
    , FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
    End Sub

  4. #4
    Registered User
    Join Date
    03-25-2013
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: How to call a click button which is on another spread sheet in your MACRO

    Furthermore, under test1 spread sheet there is a button which i want to press. Below is code linked to that button

    button is called cmdAdhocRun_Click()
    which Calls RefreshData_Adhoc

    ta

  5. #5
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: How to call a click button which is on another spread sheet in your MACRO

    Try this..

    Please Login or Register  to view this content.
    Last edited by Debraj Roy; 08-02-2013 at 07:54 AM.

  6. #6
    Registered User
    Join Date
    03-25-2013
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: How to call a click button which is on another spread sheet in your MACRO

    @ Debraj Roy you sir are amazing. many thanks. it works.

    Another quick problem, Test1 is a macro enabled spead sheet, when i save it as, i save it as a non macro workbook.

    Which creats a popup saying you sure you want to change type. How can i automate that 'yes' click.

    Macro doesn't seem to record that action !

    Thanks again

  7. #7
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: How to call a click button which is on another spread sheet in your MACRO

    Try this..

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    03-25-2013
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: How to call a click button which is on another spread sheet in your MACRO

    Sorry, it didn't work.

    I Want to automate saving of a macro to non-macro workbook

    sorry

  9. #9
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: How to call a click button which is on another spread sheet in your MACRO

    OK.. then try this..

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    03-25-2013
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: How to call a click button which is on another spread sheet in your MACRO

    I get the 'object doesn't suppost this property or method' error.

    sorry to trouble you mate.

    p.s its the 'macro free workbook' pop up which i want to get rid off. it always asks for me to press 'Yes' or no - ta
    Last edited by kbriaz; 08-02-2013 at 09:45 AM.

  11. #11
    Registered User
    Join Date
    03-25-2013
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: How to call a click button which is on another spread sheet in your MACRO

    Got it. Thanks for your help mate

    Sub Test()
    Application.DisplayAlerts = False
    ActiveWorkbook.SaveAs Filename:="C:\Test Folder\Test.xlsx", _
    FileFormat:=xlOpenXMLWorkbook
    Application.DisplayAlerts = True
    ActiveWorkbook.Close
    End Sub

  12. #12
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: How to call a click button which is on another spread sheet in your MACRO

    Glad that you solved it..

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Disable Right Click for Macro Button in excel sheet
    By gorkikumar in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-02-2013, 08:08 AM
  2. Call button click event from a button on anther sheet
    By ajaykgarg in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-25-2010, 09:27 AM
  3. check box is clicked and click ok will call macro
    By pichai in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-18-2008, 09:08 AM
  4. [SOLVED] Call Macro using right click menu
    By Ivan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-03-2006, 09:35 PM
  5. [SOLVED] Call Userfor and click button with macro
    By ExcelMonkey in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-25-2005, 01:06 PM

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