This excel find/replace code works great under Excel 2003 but bombs with an
error (pasted below the code) in Excel 2000. Can anyone suggest an
alternative to make both happy? I am using vb.net windows application. I
also tried creating an object and assigning the find/replace event to it but
I also received errors.
I am a little under the gun on this one....
WSheet.Application.Selection.Replace(What:="NONE", Replacement:="",
LookAt:=1, _
SearchOrder:=1, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False)
WSheet.Application.Selection.Replace.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.In vokeMember(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(MouseEventAr gs 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(M essage& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam) 2 9849
Hi Scorp,
Is that (double replace) WSheet.Application.Selection.Replace.Replace(What: ="PRODUCTGROUP",
a typo or is it really in your code? Could 2003 have compensated for it
but not 2000?
HTH,
Bernie
"scorpion53061" <Its the end of the world as we know it@here.com> wrote in
message news:e0**************@TK2MSFTNGP12.phx.gbl... This excel find/replace code works great under Excel 2003 but bombs with
an error (pasted below the code) in Excel 2000. Can anyone suggest an alternative to make both happy? I am using vb.net windows application. I also tried creating an object and assigning the find/replace event to it
but I also received errors.
I am a little under the gun on this one....
WSheet.Application.Selection.Replace(What:="NONE", Replacement:="", LookAt:=1, _ SearchOrder:=1, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False)
WSheet.Application.Selection.Replace.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.In vokeMember(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(MouseEventAr gs 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(M essage& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
> Is that (double replace) WSheet.Application.Selection.Replace.Replace
yep typo......
sorry :( This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Steven Stewart |
last post by:
I have a user who has been using Excel for a while to keep statistics
and print reports. She finds using it cumbersome because of long
formulas...
|
by: Frank X |
last post by:
Excel 2002 introduced a capability to add custom worksheet functions to
Excel direct from a COM/ActiveX object.
I can use C# to develop a COM...
|
by: Mansi |
last post by:
I need to do some research on how to use excel automation from c#. Does
anyone know of any good books related to this subject?
Thanks.
Mansi
|
by: D. Shane Fowlkes |
last post by:
This most likely belongs in another forum but I thought I'd start here. I
have a COM Object written in VB6. The DLL will access MS Excel and use...
|
by: a.theil |
last post by:
Please help!
I need a simple excel automation, just 2 write some files into excel.
I do:
Dim oXL As Excel.Application
Dim oWB As...
|
by: Tim Marsden |
last post by:
Hi,
I am currently creating an instance of Excel using VB.NET Automation.
dim xl as Excel.Application
xl = new Excel.Application
However,...
|
by: Maxwell2006 |
last post by:
Hi,
We have Excel 2003 templates and we need to automatically generate excel
2003 xls files based on our SQL server database tables' data. Since...
|
by: saragoesnuts |
last post by:
I have a program that automates to Excel with information in tables.
I want to add charts to the excel file (pie charts, bar charts, etc).
Is...
|
by: =?Utf-8?B?THluZXJz?= |
last post by:
Hello All,
We have a VB.NET application writen using VS 2003. This application apens an
excel file from a vendor, reads the data and performs...
|
by: concettolabs |
last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
|
by: better678 |
last post by:
Question:
Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct?
Answer:
Java is an object-oriented...
|
by: CD Tom |
last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
|
by: CD Tom |
last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
|
by: Naresh1 |
last post by:
What is WebLogic Admin Training?
WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
|
by: jalbright99669 |
last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
|
by: Matthew3360 |
last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function.
Here is my code.
...
|
by: Matthew3360 |
last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
|
by: AndyPSV |
last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
| |