Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2008

Tip: Looking for answers? Try searching our database.

Does the new Excel SDK support previous Excel versions?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Blair - 26 Sep 2007 04:58 GMT
I can not get the examples provided in the SDK to work under Excel
2000, they do work under Excel 2007.
Does anyone know what I need to do to get it to work in Excel 2000?

Thanks,

Blair
Steve Dalton - 26 Sep 2007 08:06 GMT
Hi Blair

The new SDK sample code is written only in terms of the XLOPER12 structure
which is not supported in earlier versions.  To create XLLs that will work
with 2007 and earlier versions, you have two choices:
1. Use the old SDK.  The resulting XLL is fully supported in Excel 2007 but
will not be able to take advantage of some of the new C API features (access
to bigger grid, multi-threading, Unicode strings).
2. Create your own library or project that detects the running version and
combines XLOPER and XLOPER12 functionality, and uses XLOPER12s only when
running 2007.

If you decide to go down the second path, here's a quick summary of the
differences between the old and new C API that you will need to consider:
1. XLOPER12 added to the new, XLOPER still fully supported in the new.
2. XLOPER12 integers are all 32-bit, strings are Unicode wchar_t, row and
column integers are all 32-bit integers (defined as RW and COL)
3. 2007 supports XLL worksheet functions being registered as thread-safe
with addition of '$' to the type_text argument to xlfRegister.  (There are
also new type_text codes for the new data types).
4. Those of the XLL interface callbacks that take or return XLOPERs are
supplemented by XLOPER12 versions in 2007 (e.g. xlAutoRegister and
xlAutoRegister12, xlAutoFree and xlAutoFree12).
5. There is a new FP12  floating point array structure. The old FP floating
point array structure is still supported.

You could attempt to re-write the new SDK projects and Framework library in
terms of XLOPERs, but that could be tricky.

A number of third parties who have free or commercial XLL (or XLL-related)
libraries have developed (or are developing) frameworks that will provide
support for both old and new versions.  My own book's 2nd edition contains a
C++ class that demonstrates the issues and one possible solution.

Regards

Steve Dalton

>I can not get the examples provided in the SDK to work under Excel
> 2000, they do work under Excel 2007.
[quoted text clipped - 3 lines]
>
> Blair
Andrew Lockhart - 27 Sep 2007 21:59 GMT
Steve,

Thought it might be worth pointing out that most people don't need to
use the new SDK to access the big grid, if you are writing functions
using parameter types where Excel is automatically coercing the
XLOPERS into values for you it appears to just work, i.e. parameters
of type P.

Also you don't need the new SDK to access the multi-threading, again
you can just detect whether your XLL is running in Excel 2007 and
register the function using the old Excel4 routine but supply a
slightly different registration string, i.e. appending the $ at the
end of the function signature.

I spent ages waiting for the new SDK only to find that our project
does not need it and that we can already access the big grid and
register functions as thread safe.

Andrew Lockhart

On Sep 26, 8:06 am, "Steve Dalton"
<NOsteveSPAM(at)NOeigensysSPAM(dot)com> wrote:
> Hi Blair
>
[quoted text clipped - 43 lines]
>
> - Show quoted text -
Steve Dalton - 28 Sep 2007 11:07 GMT
Hi Andrew, yes you are absolutely right about thread-safe functions.  You
can do it with the old SDK.  But the P data type is still an XLOPER and so
still limited by the size of the row and column integers it contains, which
for type P resulting from a range reference (an XLOPER xltypeMulti) is WORD
rows by WORD columns.  You may be right that the internal conversion from
XLOPER12 to the XLOPER that gets delivered to the XLL in Excel 2007 will
convert more than the 256 columns of Excel 2003 and up to the 2^14 columns
of Excel 2007 (I haven't tested this myself), but it can't pass you more
than 2^16 rows.

Steve

> Steve,
>
[quoted text clipped - 75 lines]
>>
>> - Show quoted text -
Danielle Cohen - 25 Mar 2008 22:04 GMT
I have a 10+ year old add-in (still using Excel4v) that is fairly complex.  
Everything seems to work fine in Excel2007 except for a piece of logic that
asks for the last cell in a sheet -

xlcSelectLastCell
free XLOPER xRes that is returned
xlfActiveCell
xRes is of type error where in previous version of Excel it was a range

note that the error is returned only when this logic is executing after
using xlcSelect (anchor column) then xlcInsert to insert a new column.  If I
haven't inserted a new column then the xlfActiveCell in the logic above does
give me a valid range.

any ideas why my insert is messing with my last cell?

Thanks!

-- Danielle

url:http://www.ureader.com/msg/1039312.aspx
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.