D
DaBookshah
Hi there. I previously created a different topic about this, but its
dissapeared in the mean-time, and I didnt explain myself very well
anyway it seems.
Basically I have a program written in VB, using Visual Basic for
Applications with Excel. Now this program works fine with Excel 2003,
but I get a run-time error with Excel 2000 relating to the signature of
the Range.Sort method. I am not using any of the last 3 parameters,
which were only added in 2003. According to what I was told previously,
the dependency is somehow "recompiled" or something behind the scenes,
so that if my program runs on a computer with excel 2000, it realises
this and uses that. But that doesn't help explain my error.
I am using late-binding for this, and I can see from the error message
that my program is still trying to call Range.Sort on Excel 2000 with
the parameters DataSortOption 1,2 and 3, which dont exist in 2000. I
have no idea how to fix this, but i think it might be related to the
use of late-binding?
************** Exception Text **************
System.Reflection.TargetParameterCountException: Number of parameters
specified does not match the expected number.
at System.RuntimeType.ForwardCallToInvokeMember(String memberName,
BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&
msgData)
at Microsoft.Office.Interop.Excel.Range.Sort(Object Key1,
XlSortOrder Order1, Object Key2, Object Type, XlSortOrder Order2,
Object Key3, XlSortOrder Order3, XlYesNoGuess Header, Object
OrderCustom, Object MatchCase, XlSortOrientation Orientation,
XlSortMethod SortMethod, XlSortDataOption DataOption1, XlSortDataOption
DataOption2, XlSortDataOption DataOption3)
at exceltest.Form1.StartExcel(DateTime StartDate, DateTime EndDate,
Worksheet& currentWorkSheet, Connection& Connection)
at exceltest.Form1.GenerateButton_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.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&
m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
exceltest
Assembly Version: 1.0.2359.22364
Win32 Version: 1.0.2359.22364
CodeBase:
file:///C:/Program%20Files/InTime%20Extractor/exceltest.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
ADODB
Assembly Version: 7.0.3300.0
Win32 Version: 7.10.3077
CodeBase: file:///C:/Program%20Files/InTime%20Extractor/ADODB.DLL
----------------------------------------
Microsoft.Office.Interop.Excel
Assembly Version: 11.0.0.0
Win32 Version: 11.0.5530
CodeBase:
file:///C:/Program%20Files/InTime%20Extractor/Microsoft.Office.Interop.Excel.DLL
dissapeared in the mean-time, and I didnt explain myself very well
anyway it seems.
Basically I have a program written in VB, using Visual Basic for
Applications with Excel. Now this program works fine with Excel 2003,
but I get a run-time error with Excel 2000 relating to the signature of
the Range.Sort method. I am not using any of the last 3 parameters,
which were only added in 2003. According to what I was told previously,
the dependency is somehow "recompiled" or something behind the scenes,
so that if my program runs on a computer with excel 2000, it realises
this and uses that. But that doesn't help explain my error.
I am using late-binding for this, and I can see from the error message
that my program is still trying to call Range.Sort on Excel 2000 with
the parameters DataSortOption 1,2 and 3, which dont exist in 2000. I
have no idea how to fix this, but i think it might be related to the
use of late-binding?
************** Exception Text **************
System.Reflection.TargetParameterCountException: Number of parameters
specified does not match the expected number.
at System.RuntimeType.ForwardCallToInvokeMember(String memberName,
BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&
msgData)
at Microsoft.Office.Interop.Excel.Range.Sort(Object Key1,
XlSortOrder Order1, Object Key2, Object Type, XlSortOrder Order2,
Object Key3, XlSortOrder Order3, XlYesNoGuess Header, Object
OrderCustom, Object MatchCase, XlSortOrientation Orientation,
XlSortMethod SortMethod, XlSortDataOption DataOption1, XlSortDataOption
DataOption2, XlSortDataOption DataOption3)
at exceltest.Form1.StartExcel(DateTime StartDate, DateTime EndDate,
Worksheet& currentWorkSheet, Connection& Connection)
at exceltest.Form1.GenerateButton_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.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&
m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
exceltest
Assembly Version: 1.0.2359.22364
Win32 Version: 1.0.2359.22364
CodeBase:
file:///C:/Program%20Files/InTime%20Extractor/exceltest.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
ADODB
Assembly Version: 7.0.3300.0
Win32 Version: 7.10.3077
CodeBase: file:///C:/Program%20Files/InTime%20Extractor/ADODB.DLL
----------------------------------------
Microsoft.Office.Interop.Excel
Assembly Version: 11.0.0.0
Win32 Version: 11.0.5530
CodeBase:
file:///C:/Program%20Files/InTime%20Extractor/Microsoft.Office.Interop.Excel.DLL