Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
First of all i don't know english well, i am very sorry therefore... :(
I have 1055 pieces of excel file and i must add some macro them. They our product's files and they are same files. I have a good idea then this. If i make an add-in(xla), my problem will finish, but i must learn how can i do OnSheetCalculate or OnSheetChange event. Becouse i want to control my files from add-in. Is there anyone help me about this subjuct... I will to pray very much how help me... |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
There is a mistake at the end of my mail. I fix it... :)
Not how, it must be who. :) "Erkan" , haber iletisinde þunlarý ... First of all i don't know english well, i am very sorry therefore... :( I have 1055 pieces of excel file and i must add some macro them. They our product's files and they are same files. I have a good idea then this. If i make an add-in(xla), my problem will finish, but i must learn how can i do OnSheetCalculate or OnSheetChange event. Becouse i want to control my files from add-in. Is there anyone help me about this subjuct... I will to pray very much how help me... |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Events in addins are a little tricky. You need to have a class and a module.
Insert a Class and name it clsEventClass. Add the following code to the class Option Explicit Private WithEvents xlApp As Excel.Application Private Sub Class_Initialize() Set xlApp = Excel.Application End Sub Private Sub xlApp_SheetChange(ByVal Sh As Object, ByVal Target As Range) MsgBox Sh.Name & vbTab & Target.Address End Sub Private Sub xlApp_WorkbookBeforeSave(ByVal Wb As Workbook, ByVal SaveAsUI As Boolean, Cancel As Boolean) MsgBox "Tada" End Sub Now you need to add a module and put the following code in it to create an instance of the class when the addin loads Option Explicit Public evtEvents As clsEventClass Public Sub Auto_Open() Set evtEvents = New clsEventClass End Sub -- HTH... Jim Thomlinson "Erkan" wrote: There is a mistake at the end of my mail. I fix it... :) Not how, it must be who. :) "Erkan" , haber iletisinde þunlarý ... First of all i don't know english well, i am very sorry therefore... :( I have 1055 pieces of excel file and i must add some macro them. They our product's files and they are same files. I have a good idea then this. If i make an add-in(xla), my problem will finish, but i must learn how can i do OnSheetCalculate or OnSheetChange event. Becouse i want to control my files from add-in. Is there anyone help me about this subjuct... I will to pray very much how help me... |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I don't know how can i thank to you for your valuable help Jim Thomlinson.
You are right. Events in addins subjuct is a little hard for me. I must work very much on this subjuct. I used your codes and they are running very good... You rescue me from a big problem. You are very good person... :) I hope everything be as you want... :) "Jim Thomlinson" , haber iletisinde þunlarý ... Events in addins are a little tricky. You need to have a class and a module. Insert a Class and name it clsEventClass. Add the following code to the class Option Explicit Private WithEvents xlApp As Excel.Application Private Sub Class_Initialize() Set xlApp = Excel.Application End Sub Private Sub xlApp_SheetChange(ByVal Sh As Object, ByVal Target As Range) MsgBox Sh.Name & vbTab & Target.Address End Sub Private Sub xlApp_WorkbookBeforeSave(ByVal Wb As Workbook, ByVal SaveAsUI As Boolean, Cancel As Boolean) MsgBox "Tada" End Sub Now you need to add a module and put the following code in it to create an instance of the class when the addin loads Option Explicit Public evtEvents As clsEventClass Public Sub Auto_Open() Set evtEvents = New clsEventClass End Sub -- HTH... Jim Thomlinson "Erkan" wrote: There is a mistake at the end of my mail. I fix it... :) Not how, it must be who. :) "Erkan" , haber iletisinde ?unlary ... First of all i don't know english well, i am very sorry therefore... :( I have 1055 pieces of excel file and i must add some macro them. They our product's files and they are same files. I have a good idea then this. If i make an add-in(xla), my problem will finish, but i must learn how can i do OnSheetCalculate or OnSheetChange event. Becouse i want to control my files from add-in. Is there anyone help me about this subjuct... I will to pray very much how help me... |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Event handler in a cell | Excel Programming | |||
Global event handler?? | Excel Programming | |||
where is the workbook_open event handler??? | Excel Programming | |||
different IDispatch in event handler | Excel Programming | |||
Cell Event Handler | Excel Programming |