Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Application-Defined or Object-Defined Error on simple code
I seem to continually struggle with this error anytime I write vba code
for excel. I have the following code: Private Sub cmdUpdate_Click() Workbooks("Inventory").Worksheets("RawData").Colum ns("G").Replace What:="{01", Replacement:="Newton", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False End Sub This code runs when a user clicks a command button but always gives me the application-defined or object-defined error. Others who have tried to help me say they cannot replicate the error. Is anyone else struggling with this? Thanks, Brent |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Application-Defined or Object-Defined Error on simple code
If the button is on a worksheet, and you are in Excel97, change
the TakeFocusOnClick property to False. This is a bug that was fixed in 2000. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Fid" wrote in message ps.com... I seem to continually struggle with this error anytime I write vba code for excel. I have the following code: Private Sub cmdUpdate_Click() Workbooks("Inventory").Worksheets("RawData").Colum ns("G").Replace What:="{01", Replacement:="Newton", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False End Sub This code runs when a user clicks a command button but always gives me the application-defined or object-defined error. Others who have tried to help me say they cannot replicate the error. Is anyone else struggling with this? Thanks, Brent |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Run-time error '50290': Application-defined or object-defined erro | Excel Discussion (Misc queries) | |||
error: ActiveCell.Offset(0, -1).Select = Application-defined or object-defined error | Excel Programming | |||
Application-Defined or Object-Defined Error on simple code | Excel Programming | |||
Application-defined or object-defined error - missing the basics | Excel Programming | |||
Macro Run-time Error 1004 Application Defined or Object Defined Error | Excel Programming |