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)
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)