Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 265
Default Workbook_SheetSelectionChange problem in my add in

Hi ,

I made an Add In with a Workbook_SheetSelectionChange macro
so that the user of my add in will run the macro when he changes the cell
selection

The problem is that sience the add in work book is not selection-changed,
therefore the macro is not executed; how to tell VB that the macro in the add
in applies to all the open workbooks (Workbook_SheetSelectionChange)?

TIA
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Workbook_SheetSelectionChange problem in my add in

Consider having the add-in copy the Event macro to each open workbook.
--
Gary''s Student - gsnu200828


"filo666" wrote:

Hi ,

I made an Add In with a Workbook_SheetSelectionChange macro
so that the user of my add in will run the macro when he changes the cell
selection

The problem is that sience the add in work book is not selection-changed,
therefore the macro is not executed; how to tell VB that the macro in the add
in applies to all the open workbooks (Workbook_SheetSelectionChange)?

TIA

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Workbook_SheetSelectionChange problem in my add in

Place this in your add-in Thisworkbook module

Private WithEvents XLApp As Excel.Application

Private Sub Workbook_Open()
Set XLApp = Excel.Application
End Sub

Private Sub XLApp_SheetSelectionChange(ByVal Sh As Object, _
ByVal Target As Range)
MsgBox "hello"
End Sub


Gord Dibben MS Excel MVP

On Thu, 22 Jan 2009 06:45:01 -0800, filo666
wrote:

Hi ,

I made an Add In with a Workbook_SheetSelectionChange macro
so that the user of my add in will run the macro when he changes the cell
selection

The problem is that sience the add in work book is not selection-changed,
therefore the macro is not executed; how to tell VB that the macro in the add
in applies to all the open workbooks (Workbook_SheetSelectionChange)?

TIA


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 265
Default Workbook_SheetSelectionChange problem in my add in

Hi Gordon, thanks for your answer;

It did not worked out, when I tried to get the following information:

rw = ActiveWorkbook.ActiveSheet.Cells.Find(What:="*",
After:=ActiveSheet.Range("A1"), Lookat:=xlPart, LookIn:=xlFormulas, _
SearchOrder:=xlByRows, SearchDirection:=xlPrevious, MatchCase:=False).Row
rw appear as empty.

any help will be appresiated

"Gord Dibben" wrote:

Place this in your add-in Thisworkbook module

Private WithEvents XLApp As Excel.Application

Private Sub Workbook_Open()
Set XLApp = Excel.Application
End Sub

Private Sub XLApp_SheetSelectionChange(ByVal Sh As Object, _
ByVal Target As Range)
MsgBox "hello"
End Sub


Gord Dibben MS Excel MVP

On Thu, 22 Jan 2009 06:45:01 -0800, filo666
wrote:

Hi ,

I made an Add In with a Workbook_SheetSelectionChange macro
so that the user of my add in will run the macro when he changes the cell
selection

The problem is that sience the add in work book is not selection-changed,
therefore the macro is not executed; how to tell VB that the macro in the add
in applies to all the open workbooks (Workbook_SheetSelectionChange)?

TIA



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
Workbook_SheetSelectionChange in an Addin rchan11 Excel Programming 3 November 5th 07 03:37 PM
Workbook_SheetSelectionChange in going infinite sency Excel Programming 2 February 17th 07 05:44 AM
Improving Workbook_SheetSelectionChange for enhanced Autofiltering aafraga[_2_] Excel Programming 5 April 10th 06 01:11 PM
Workbook_SheetSelectionChange R.VENKATARAMAN Excel Programming 3 January 23rd 05 11:44 AM
Problem when multipple users access shared xl-file at the same time, macrocode for solve this problem? OCI Excel Programming 0 May 16th 04 10:40 PM


All times are GMT +1. The time now is 10:54 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"