The only other way to simulate an actual click is to do something like the following (assuming a form with cmdButton1 and cmdButton2): Private Sub cmdButton1_Click() #Excel for mac vba to copy a sheet without command button windowsIt *may* be possible to do this using Windows APIs if you could find the window handle of the button itself, but this would be complex. You can execute the command button's Click event itself, as already mentioned, but you cannot programatically click the button in VBA code. Value property available for command buttons. I don't know about Excel VBA, but in Access 2007 VBA, there is no. #Excel for mac vba to copy a sheet without command button codeIs there a line of code that would allow me to do that, given the constraints imposed by the password protection in Workbook 2? Of course, I can carry out the operation manually, but that would defeat the purpose of writing a macro in the first place. All I am missing is a way to click the command button in Workbook 2. I have written Macro 1 with a simple For loop that can send and retrieve the data between the two workbooks. It did not give me a line of code for the command button click that occurs immediately after activating Workbook 2. When I used the macro recorder in Workbook 1 to write Macro 1, it only showed me code lines for activating Workbook 2, and then activating Workbook 1 again. Macro 2 does not show in the macro menu for Workbook 2, and I cannot use the macro recorder in Workbook 2 (would require the password) to identify the code that would be associated with clicking the button. Since Workbook 2 is password-protected, I can only access Macro 2 by clicking the command button. The button must be clicked every time new input data is sent to Workbook 2. Workbook 2 was assembled by someone else, and its calculations require exercising Macro 2, which is activated by clicking a command button in Workbook 2. I'm using Macro 1 to send input data to Workbook 2, and then retrieve calculations from Workbook 2 and copy them back to Workbook 1. Workbook 1 contains Macro 1, which I wrote. Here is my situation: I have two Excel workbooks that have macros in them. I'm not the original poster, but I have a similar problem.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |