control As IRibbonControl Unable to call

martinez_pedro

New Member
Joined
Aug 19, 2009
Messages
28
So I am trying to call my macro from another macro and ever since i added
control As IRibbonControl i no longer able to called from another macros
Does anyone know how to fix this problem
Thank you for your the help!!
Code:
Sub DeleteBlankRows(control As IRibbonControl)
LastRow = Cells(Cells.Rows.Count, "B").End(xlUp).Row
Range("G2:G" & LastRow).Select
On Error Resume Next
Selection.SpecialCells(xlCellTypeBlanks).EntireRow.Delete
End Sub
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
What is the point of adding the iRibbonControl argument as part of the macro. You don't use it and it doesn't seem necessary for the code you provided.

Also, when calling that macro from the other one, are you passing a valid control object (vs. a string value such as the name of an object)?
 
Upvote 0
You need that kind of subroutine signature only when it is a procedure that is called when a ribbon button is clicked.
So I am trying to call my macro from another macro and ever since i added
control As IRibbonControl i no longer able to called from another macros
Does anyone know how to fix this problem
Thank you for your the help!!
Code:
Sub DeleteBlankRows(control As IRibbonControl)
LastRow = Cells(Cells.Rows.Count, "B").End(xlUp).Row
Range("G2:G" & LastRow).Select
On Error Resume Next
Selection.SpecialCells(xlCellTypeBlanks).EntireRow.Delete
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,915
Messages
6,122,214
Members
449,074
Latest member
cancansova

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top