Find/replace Difference in 2000 and XP/2003

S

scorpion53061

What am I doing wrong?

in this code it searches the excel spreadsheet for text, replaces it. XP
and 2003 it works beautifully.

In Excel 2000 it bombs saying a automation error (see below code for error
message) it is a problem.

Those in my vb.net group are not responding. You guys are my last
hope......Thank you for any help you can give.

Can anyone suggest a workaround? And why would it work in 2003 and XP and
not in 2000?

I also tried late binding but to no avail. Same error.

WSheet.Application.Selection.Replace(What:="NONE", Replacement:="",
LookAt:=1, _
SearchOrder:=1, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False)

WSheet.Application.Selection.Replace(What:="PRODUCTGROUP",
Replacement:="GROUP", LookAt:=1, _
SearchOrder:=1, MatchCase:=False,
SearchFormat:=False, _
ReplaceFormat:=False)


See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Runtime.InteropServices.COMException (0x800A03EC): Exception from
HRESULT: 0x800A03EC.
at System.RuntimeType.InvokeDispMethod(String name, BindingFlags
invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32
culture, String[] namedParameters)
at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr,
Binder binder, Object target, Object[] args, ParameterModifier[] modifiers,
CultureInfo culture, String[] namedParameters)
at Microsoft.VisualBasic.CompilerServices.VBBinder.InvokeMember(String
name, BindingFlags invokeAttr, Type objType, IReflect objIReflect, Object
target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture,
String[] namedParameters)
at
Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object
o, Type objType, String name, Object[] args, String[] paramnames, Boolean[]
CopyBack, Boolean IgnoreReturn)
at Microsoft.VisualBasic.CompilerServices.LateBinding.LateCall(Object o,
Type objType, String name, Object[] args, String[] paramnames, Boolean[]
CopyBack)
at Unlock_Orders.Form3.GetAllItemsSpecifiedLists()
at Unlock_Orders.Form3.Button4_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
 
J

Jean-Guy Marcil

Have you tried posting in an Excel group?

--
Cheers!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org


scorpion53061 said:
What am I doing wrong?

in this code it searches the excel spreadsheet for text, replaces it. XP
and 2003 it works beautifully.

In Excel 2000 it bombs saying a automation error (see below code for error
message) it is a problem.

Those in my vb.net group are not responding. You guys are my last
hope......Thank you for any help you can give.

Can anyone suggest a workaround? And why would it work in 2003 and XP and
not in 2000?

I also tried late binding but to no avail. Same error.

WSheet.Application.Selection.Replace(What:="NONE", Replacement:="",
LookAt:=1, _
SearchOrder:=1, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False)

WSheet.Application.Selection.Replace(What:="PRODUCTGROUP",
Replacement:="GROUP", LookAt:=1, _
SearchOrder:=1, MatchCase:=False,
SearchFormat:=False, _
ReplaceFormat:=False)


See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Runtime.InteropServices.COMException (0x800A03EC): Exception from
HRESULT: 0x800A03EC.
at System.RuntimeType.InvokeDispMethod(String name, BindingFlags
invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32
culture, String[] namedParameters)
at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr,
Binder binder, Object target, Object[] args, ParameterModifier[] modifiers,
CultureInfo culture, String[] namedParameters)
at Microsoft.VisualBasic.CompilerServices.VBBinder.InvokeMember(String
name, BindingFlags invokeAttr, Type objType, IReflect objIReflect, Object
target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture,
String[] namedParameters)
at
Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object
o, Type objType, String name, Object[] args, String[] paramnames, Boolean[]
CopyBack, Boolean IgnoreReturn)
at Microsoft.VisualBasic.CompilerServices.LateBinding.LateCall(Object o,
Type objType, String name, Object[] args, String[] paramnames, Boolean[]
CopyBack)
at Unlock_Orders.Form3.GetAllItemsSpecifiedLists()
at Unlock_Orders.Form3.Button4_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
 
S

scorpion53061

Have you tried posting in an Excel group?

The office automation group hasnt had any idea.

I was not aware of any Excel based group that would help me. Do you have a
suggestion?

Sorry if I offended....
 
J

Jean-Guy Marcil

Hi there,

No offense taken, I was just trying to steer you to a place where Excel
experts might be able to answer your question faster. While most of us have
had experience with Excel vba, it is not necessarily everyone's strong
suit...

Try
microsoft.public.excel.programming
or
microsoft.public.excel.interopoledde

HTH

--
Cheers!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
P

Peter Hewett

Hi

This is a Word News Group try an Excel NG.

Cheers - Peter

What am I doing wrong?

in this code it searches the excel spreadsheet for text, replaces it. XP
and 2003 it works beautifully.

In Excel 2000 it bombs saying a automation error (see below code for error
message) it is a problem.

Those in my vb.net group are not responding. You guys are my last
hope......Thank you for any help you can give.

Can anyone suggest a workaround? And why would it work in 2003 and XP and
not in 2000?

I also tried late binding but to no avail. Same error.

WSheet.Application.Selection.Replace(What:="NONE", Replacement:="",
LookAt:=1, _
SearchOrder:=1, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False)

WSheet.Application.Selection.Replace(What:="PRODUCTGROUP",
Replacement:="GROUP", LookAt:=1, _
SearchOrder:=1, MatchCase:=False,
SearchFormat:=False, _
ReplaceFormat:=False)


See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Runtime.InteropServices.COMException (0x800A03EC): Exception from
HRESULT: 0x800A03EC.
at System.RuntimeType.InvokeDispMethod(String name, BindingFlags
invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32
culture, String[] namedParameters)
at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr,
Binder binder, Object target, Object[] args, ParameterModifier[] modifiers,
CultureInfo culture, String[] namedParameters)
at Microsoft.VisualBasic.CompilerServices.VBBinder.InvokeMember(String
name, BindingFlags invokeAttr, Type objType, IReflect objIReflect, Object
target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture,
String[] namedParameters)
at
Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall (Object
o, Type objType, String name, Object[] args, String[] paramnames, Boolean []
CopyBack, Boolean IgnoreReturn)
at Microsoft.VisualBasic.CompilerServices.LateBinding.LateCall(Object o,
Type objType, String name, Object[] args, String[] paramnames, Boolean[]
CopyBack)
at Unlock_Orders.Form3.GetAllItemsSpecifiedLists()
at Unlock_Orders.Form3.Button4_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top