Hi All,
Looking for help from the experts. I am unable to copy/cut/paste between workbooks. I'm fairly certain it is because of a Class event I have to check if the workbook has been changed, but can't figure out a workaround.
I am building an addin that makes a custom toolbar of icons for running different procedures. I only want certain buttons available on certain types of worksheets (that contain specific data in the header) that the users have as templates. To do so, I found online postings leading me to create a Class Event
where statuscheck is my procedure that looks in the header for the correct info and enables/disables the correct buttons
in my workbook_open I call a routine named InitiateWorkbookChangeEvent..
It works great for enabling/disabling the buttons, but if I need the users to still be able to copy and paste between different workbooks. Copy and pasting within the same workbook works fine. But if you copy something, as soon as you click on another workbook, the flashing outline of the selection you want to copy in the other workbook disappears.
If there is a different way for me to catch when a user changes workbooks so that I enable the correct buttons, I'd appreciate that help as well.
Thank you in advance!
Looking for help from the experts. I am unable to copy/cut/paste between workbooks. I'm fairly certain it is because of a Class event I have to check if the workbook has been changed, but can't figure out a workaround.
I am building an addin that makes a custom toolbar of icons for running different procedures. I only want certain buttons available on certain types of worksheets (that contain specific data in the header) that the users have as templates. To do so, I found online postings leading me to create a Class Event
Code:
Public WithEvents App as Application
Private Sub App_WorkbookActivate(ByVal Wb as Workbook)
call statuscheck
End Sub
where statuscheck is my procedure that looks in the header for the correct info and enables/disables the correct buttons
in my workbook_open I call a routine named InitiateWorkbookChangeEvent..
Code:
dim myobject as New CExcelEvents
Sub InitiateWorkbookChangeEvent()
Set myobject.App = Application
End Sub
It works great for enabling/disabling the buttons, but if I need the users to still be able to copy and paste between different workbooks. Copy and pasting within the same workbook works fine. But if you copy something, as soon as you click on another workbook, the flashing outline of the selection you want to copy in the other workbook disappears.
If there is a different way for me to catch when a user changes workbooks so that I enable the correct buttons, I'd appreciate that help as well.
Thank you in advance!