zegerma.blogg.se

Excel vba get activex button from another sheet
Excel vba get activex button from another sheet













excel vba get activex button from another sheet
  1. #EXCEL VBA GET ACTIVEX BUTTON FROM ANOTHER SHEET HOW TO#
  2. #EXCEL VBA GET ACTIVEX BUTTON FROM ANOTHER SHEET CODE#
  3. #EXCEL VBA GET ACTIVEX BUTTON FROM ANOTHER SHEET WINDOWS#

'Row 4 is where individual location-based buttons reside.

#EXCEL VBA GET ACTIVEX BUTTON FROM ANOTHER SHEET WINDOWS#

Create 3 more Windows and 3 more Linux systems. 'create 6 columns with 3 Windows and 3 Linux systems as rows. (And I haven't worked with Telnet in YEARS! This is included to show how different devices can have the same function performed on them.)

#EXCEL VBA GET ACTIVEX BUTTON FROM ANOTHER SHEET CODE#

This code is untested as it was modified from another macro that IS tested and working. But it runs them all from the location of the "Run All" button, which is quite useless as there are no IPs below

excel vba get activex button from another sheet

'Application.Run (ActiveSheet.Cells(ActiveSheet.Buttons(Application.Caller).TopLeftCell.Row + 1, ActiveSheet.Buttons(Application.Caller).TopLeftCell.Column).Activate) 'Run Application.Caller '(ActiveSheet.Cells(ActiveSheet.Buttons(Application.Caller).TopLeftCell.Row - 2, ActiveSheet.Buttons(Application.Caller).TopLeftCell.Column + 2).Activate) ' Next obj- Object variable or With block variable not set. 'Application.Run (ActiveSheet.Cells(ActiveSheet.Buttons(Application.Caller).TopLeftCell.Row - 2, ActiveSheet.Buttons(Application.Caller).TopLeftCell.Column + 2).Activate) - this activates the cell the button is in. The macro may not be available in this workbook. 'Run Application.Caller(ActiveSheet.Cells(ActiveSheet.Buttons(Application.Caller).TopLeftCell.Row - 2, ActiveSheet.Buttons(Application.Caller).TopLeftCell.Column + 2).Activate) - Cannot run the macro 'Button 8'. 'Call Button1_Click - Compile Error: Sub or function not defined

excel vba get activex button from another sheet

'End With - Compile Error: With object must be user-defined type, Object, or Variant (This *isn't* an object?) 'Worksheet("TCP").OLEObjects("HC").Click - Compile Error: Sub or function not defined 'Button3Macro - Compile Error: Sub or function not defined As I have hundreds of buttons and few macros, I need to "press" the button. Note that the difference between the two is plink and telnet. Shell ("C:\Windows\System32\cmd.exe /k cd c:\&telnet" & " " & ActiveSheet.Cells(ActiveSheet.Buttons(Application.Caller).TopLeftCell.Row + 8, ActiveSheet.Buttons(Application.Caller).TopLeftCell.Column).Value & " -l " & Range("A11") & "\" & ActiveSheet.Cells(ActiveSheet.Buttons(Application.Caller).TopLeftCell.Row - 1, ActiveSheet.Buttons(Application.Caller).TopLeftCell.Column).Value & "_" & Format(Now, "MM-DD-YYYY_hh-mm-ss") & "_uptime.txt&exit") & " -pw " & Range("A13") & " " & """ping 127.0.0.1""" & " > c:\pingtest\" & Range("A1") & "\" & ActiveSheet.Cells(ActiveSheet.Buttons(Application.Caller).TopLeftCell.Row + 7, ActiveSheet.Buttons(Application.Caller).TopLeftCell.Column).Value Shell ("C:\Windows\System32\cmd.exe /k cd c:\&plink" & " " & ActiveSheet.Cells(ActiveSheet.Buttons(Application.Caller).TopLeftCell.Row + 8, ActiveSheet.Buttons(Application.Caller).TopLeftCell.Column).Value & " -l " & Range("A11") I assign the Windows macro to 8 buttons and the Linux Macro to 6 buttons.

excel vba get activex button from another sheet

Sheets("Sheet11").Shapes("CommandButton1").Lets say I have two types of devices that need a ping test run from. Here Delete is the property of Shape object. In the below example, its deleting the command button named ‘CommandButton1’ which is on the worksheet named ‘Sheet11’.

#EXCEL VBA GET ACTIVEX BUTTON FROM ANOTHER SHEET HOW TO#

Please find the below code, it will show you how to delete or remove a command button on the worksheet. It is shown in the following Screen Shot.ĭelete CommandButton Control on the Worksheet using VBA

  • Now add the following code in between above procedure.
  • Now you can see the following code in the VBA Editor window.
  • Or right click on command button and click view code.
  • Now, Double click on the Command Button (Click).
  • Please find the below screen shot for the same.
  • On the left side find ‘Caption’ from the available properties of a Command Button.
  • Click on properties from the available list.
  • Right click on the Command Button, before that Design Mode should be turned ON.
  • Drag a Command Button on the Worksheet.
  • Click on the Command Button from the ActiveX Controls group.
  • Go To Developer Tab and then click Insert from the Controls group.
  • Please find more details about VBA ActiveX Command Button Control on the Worksheet. VBA ActiveX CommandButton Control on the Worksheet
  • Delete CommandButton Control on the Worksheet using VBA.
  • VBA ActiveX CommandButton Control on the Worksheet.














  • Excel vba get activex button from another sheet