LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Run-time error using late binding

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(Strin g 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(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.Control.ControlNativeWindow.O nMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(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
----------------------------------------

Any help is really appreciated!
Rohan

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Late binding to Excel from Access causing Object error EagleOne@microsoftdiscussiongroups[_2_] Excel Discussion (Misc queries) 4 June 14th 08 12:45 AM
Late Binding Mark Excel Programming 4 October 17th 05 04:02 PM
Late Binding examples of binding excel application HeatherO Excel Programming 13 March 17th 05 08:19 AM
Late Binding help, Please Bud Dean Excel Programming 5 September 24th 04 04:31 AM
EARLY binding or LATE binding ? jason Excel Programming 6 February 26th 04 04:57 PM


All times are GMT +1. The time now is 04:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"