PDA

View Full Version : Inserting Event into the Excel WorkSheet from VB


dgchoudary
07-03-02, 01:11
Hi

i have problem this is very urgent. i loading excel file from VB application with some data at the same time i want to load the following event into the worksheet from the VB when the excel is opening

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim rngActiveRange As Excel.Range

' Range object returned from the Selection property.
Set rngActiveRange = Selection
Call PrintRangeInfo(rngActiveRange)
End Sub

so that each cell click event i can fire this event. but how do i load this event into the active worksheet when i am loading the excel application from the Visual Basic

Thanking you

Regards
Gandhi

rnealejr
07-03-02, 01:43
What problem are you having ?

rnealejr
07-04-02, 04:55
I received your message. Are you using visual basic - creating a project from scratch, or are you using vba with excel ? In this example, using vba would be much easier - no vb project would be needed - all you would have to do is to use the events using vba. If you are creating a full blown visual basic project, are there reasons why you can not use vba in the actual excel file ?