Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() ....macros controlling macros and userforms from remote workbooks... a macro from workbook-A opens a 'userform' in workbook-B, then fills it out. there is a 'commandButton' on the 'userform' of workbook-B... how do i activate this 'commandButton' from my macro in workbook-A ? -- tad_wegner ------------------------------------------------------------------------ tad_wegner's Profile: http://www.excelforum.com/member.php...o&userid=27770 View this thread: http://www.excelforum.com/showthread...hreadid=473198 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The easiest would be to put any code that you want accessible from
workbook-A in general modules. Have the events in the userform call these procedures. rather than Private Sub Commandbutton1_click() msgbox "Click" End sub do In a general module Sub btnClick() msgbox "Click" End Sub then in the userform Module Private Sub Commandbutton1_click() btnClick End Sub then in workbook A you can do Application.run "WorkbookA.xls!btnClick" However, it appears to me your whole approach is flawed. the userform should probably be in Workbook - A. You can easily write the code for the userform to use data from the Active workbook or any other workbook you want to reference. -- Regards, Tom Ogilvy "tad_wegner" wrote in message ... ..macros controlling macros and userforms from remote workbooks... a macro from workbook-A opens a 'userform' in workbook-B, then fills it out. there is a 'commandButton' on the 'userform' of workbook-B... how do i activate this 'commandButton' from my macro in workbook-A ? -- tad_wegner ------------------------------------------------------------------------ tad_wegner's Profile: http://www.excelforum.com/member.php...o&userid=27770 View this thread: http://www.excelforum.com/showthread...hreadid=473198 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() tom- thanks for your response... i tried it (at least how i interperete what you wrote), however it did not work. what happened is that my macro from workbook-A opened the userform i workbook-B and filled it out, then paused. when i clicked th "commandbutton" a msgbox popped up. i had to "OK" it, then th commandbutton "action" happened. so it looks like i onl "boobie-trapped" the commandbutton on the userform, i didnt actuall get it to "click" from my macro in workbook-A. im confused... i couldnt agree more about the method being flawed from the git-go without getting too wrapped up in details, the nature of what i want t do is very complex and has many steps. - i developed a very large tool 'workbook-A' - another engineer developed an even larger tool 'workbook-B'. his too uses vast amounts of userforms to collect and display data (i kno little about userforms, but much about macros in general, according t me) -combining workbooks wouldnt make this easier for me, i still need t know how to activate his userform "commandbutton"s to automate ou analyses. both processes are very iterative and do hundreds o thousands of calcs (each) so i want to 'batch' all our macros togethe so i (we) dont have to feed the workbooks any additional data after w press the "go" button. the problem is his userforms are huge an complicated and i dont want to look through all the code to bypass th form... id rather fill the userform out like he wanted and submit the like they would normally be done. BTW he is no longer here, so thi makes it very difficult. please, can you instruct me one more time... last time it didnt work. thanks -- tad_wegne ----------------------------------------------------------------------- tad_wegner's Profile: http://www.excelforum.com/member.php...fo&userid=2777 View this thread: http://www.excelforum.com/showthread.php?threadid=47319 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Looks like you are trying to write some kind of keystroke macro. Afraid
that is not something I can help you with. Use SendKeys. Use Excel VBA help. However, your short term solution will probably result in long term pain. Better to invest the time and understand his code then figure out how to integrate. I would see no userforms being shown from his application, but you applying the data to the routines that his userforms would call. Still, its not something I have to do and you do have to. -- Regards, Tom Ogilvy "tad_wegner" wrote in message ... tom- thanks for your response... i tried it (at least how i interpereted what you wrote), however it did not work. what happened is that my macro from workbook-A opened the userform in workbook-B and filled it out, then paused. when i clicked the "commandbutton" a msgbox popped up. i had to "OK" it, then the commandbutton "action" happened. so it looks like i only "boobie-trapped" the commandbutton on the userform, i didnt actually get it to "click" from my macro in workbook-A. im confused... i couldnt agree more about the method being flawed from the git-go. without getting too wrapped up in details, the nature of what i want to do is very complex and has many steps. - i developed a very large tool 'workbook-A' - another engineer developed an even larger tool 'workbook-B'. his tool uses vast amounts of userforms to collect and display data (i know little about userforms, but much about macros in general, according to me) -combining workbooks wouldnt make this easier for me, i still need to know how to activate his userform "commandbutton"s to automate our analyses. both processes are very iterative and do hundreds of thousands of calcs (each) so i want to 'batch' all our macros together so i (we) dont have to feed the workbooks any additional data after we press the "go" button. the problem is his userforms are huge and complicated and i dont want to look through all the code to bypass the form... id rather fill the userform out like he wanted and submit them like they would normally be done. BTW he is no longer here, so this makes it very difficult. please, can you instruct me one more time... last time it didnt work. thanks. -- tad_wegner ------------------------------------------------------------------------ tad_wegner's Profile: http://www.excelforum.com/member.php...o&userid=27770 View this thread: http://www.excelforum.com/showthread...hreadid=473198 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
horse racing excel program | Excel Discussion (Misc queries) | |||
Is ADO dead? | Excel Programming | |||
Horse Ratings | Excel Discussion (Misc queries) | |||
How do I convert decimals to fractional odds for horse racing? | Excel Programming | |||
Adding Subtracting Time Formula-Horse Racing | Excel Discussion (Misc queries) |