Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default OnSheetChange or OnSheetCalculate Event Handler

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default OnSheetChange or OnSheetCalculate Event Handler

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default OnSheetChange or OnSheetCalculate Event Handler

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default OnSheetChange or OnSheetCalculate Event Handler

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Event handler in a cell Man Utd Excel Programming 3 June 15th 05 07:44 AM
Global event handler?? [email protected] Excel Programming 1 October 23rd 04 05:31 PM
where is the workbook_open event handler??? Steff_DK[_10_] Excel Programming 2 April 25th 04 02:43 PM
different IDispatch in event handler Dirk[_2_] Excel Programming 0 January 23rd 04 11:04 PM
Cell Event Handler David Excel Programming 3 January 19th 04 04:51 PM


All times are GMT +1. The time now is 08:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"