Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have this code in workbook#1
Global wb as workbook sub dowhat() wb.activate <<<< error here ...more code end sub ============ and this code in a sheet of workbook#2 Private Sub Worksheet_Change(ByVal Target As Range) If Target.Cells.Count 1 Then Exit Sub If Intersect(Range("B1:B20"), Target) Is Nothing Then Exit Sub application.run "workbook1.xls!dowhat" End Sub The problem is that dowaht works if run from a macro in workbook#1 but not when called from workbook#2 when a cell changes. The error I get is "Object Required" which I assume is because "wb" is empty. Can someone please let me know what I am missing. thanks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
copy worksheets to new book without linking to original book | Excel Discussion (Misc queries) | |||
to disconnect a destination book from a source book | Excel Discussion (Misc queries) | |||
Call Center Management: How to calculate 'cost per call' | Excel Discussion (Misc queries) | |||
Can you call functions between sheets in the same book in excel? | Excel Worksheet Functions | |||
Open book, check for macros, close book | Excel Programming |