Just released: Excel 2007 XLL Software Development Kit

The Microsoft Office Excel 2007 XLL Software Development Kit is out the door 
at long last. Many Excel developers have been waiting for the new XLL SDK 
for a long time now, since we released Office 2007 at the end of last year. 
It took us longer than we had initially thought to update the SDK content 
and develop the new documentation, but we hope that you will find the wait 
was worthwhile, and will be satisfied with the quality of the final SDK 
we've just released - the API files, the framework and code samples, and of 
course the extensive and detailed documentation.

Please find the new SDK here:
1. Download: 
http://www.microsoft.com/downloads/details.aspx?familyid=5272e1d1-93ab-4bd4-af18-cb6bb487e1c4&displaylang=en
2. Online documentation: 
http://msdn2.microsoft.com/en-us/library/bb687883.aspx

Excerpt from the SDK documentation:

 The Microsoft Office Excel 2007 XLL Software Development Kit is designed to 
help you understand the relevant concepts and technologies that relate to 
creating DLL add-ins for Microsoft Office Excel 2007 that use the Excel C 
API. The C API enables DLLs to be integrated tightly with Excel 2007 and to 
access the internal functionality in Excel. These DLL add-ins are known as 
XLLs, given that they are usually given the file name extension .xll.
 The primary reason for writing XLLs and using the C API is to create 
high-performance worksheet functions. Although XLL functions are frequently 
referred to as user-defined functions, the investment in time to obtain the 
understanding and skills that are required to write XLLs make this a 
technology impractical for most users. Nevertheless, the applications of 
high-performance functions-and, in Excel 2007, the ability to write 
multithreaded interfaces to powerful server resources-make it a very 
important part of Excel extensibility. The performance of XLLs is further 
enhanced in Excel 2007 by the addition of new data types and, most 
important, support for multithreading.
 The Excel 2007 XLL Software Development Kit contains a framework library 
that is designed to speed up the writing of XLLs, and also three sample 
projects.

-- 
Danny Khen
Excel Program Manager, Microsoft Corp.
[To use my email address, replace (dot) and (at) with respective chars, and 
(xxxx) with microsoft.com.]

** This posting is provided "AS IS", with no warranties, and confers no 
rights. ** 

0
Danny
9/11/2007 11:56:09 PM
excel 39879 articles. 2 followers. Follow

15 Replies
730 Views

Similar Articles

[PageSpeed] 29

According the the SDK Redist License Terms, it seems xlcall.h, xlcall.cpp, 
and xlcall32.lib
are not redistributable. I hope I'm wrong, but if not, is the appropriate 
way of providing these
is to have users download and install the Microsoft SDK?

Thanks,
Keith A. Lewis 


0
kal (6)
9/12/2007 4:37:26 PM
Dear Danny,

  Thank you for providing the new SDK.

  The only thing that the SDK lacks is a decent object oriented framework 
wrapper. It would be nice to have some classes available which would hide the 
complexity of memory management, working with specific data types 
(XLOPER/XLOPER12), registration/unregistration of 
UDFs/menus/commands/toolbars etc. The wrapper could take care of handling 
different Excel versions, working with Pascal-style strings, and many other 
little but annoying things.

  For an example of such a wrapper, please see http://xlw.sourceforge.net. 
This is an open source project which looks great, but which shouldn't be used 
in a serious commercial project as it may contain unexpected bugs. 

  The old-style C API might be more efficient than the C++ wrapper, but 
using it in modern software projects is very counterproductive and error 
prone. I am sure most (if not all) C++ developers would be interested in 
having a C++ wrapper officially supported by Microsoft.

  I've noticed that the new SDK includes two C++ classes, MemoryManager and 
MemoryPool, which is great! But the rest of things look like in the old Excel 
97 days -- that's 10 years ago..

  Do you have any plans to provide a similar object oriented framework in 
the nearest future?

  Thanks for your help!

-- 
Regards,
Antony


"Danny Khen [MSFT]" wrote:

> The Microsoft Office Excel 2007 XLL Software Development Kit is out the door 
> at long last. Many Excel developers have been waiting for the new XLL SDK 
> for a long time now, since we released Office 2007 at the end of last year. 
> It took us longer than we had initially thought to update the SDK content 
> and develop the new documentation, but we hope that you will find the wait 
> was worthwhile, and will be satisfied with the quality of the final SDK 
> we've just released - the API files, the framework and code samples, and of 
> course the extensive and detailed documentation.
> 
> Please find the new SDK here:
> 1. Download: 
> http://www.microsoft.com/downloads/details.aspx?familyid=5272e1d1-93ab-4bd4-af18-cb6bb487e1c4&displaylang=en
> 2. Online documentation: 
> http://msdn2.microsoft.com/en-us/library/bb687883.aspx
> 
> Excerpt from the SDK documentation:
> 
>  The Microsoft Office Excel 2007 XLL Software Development Kit is designed to 
> help you understand the relevant concepts and technologies that relate to 
> creating DLL add-ins for Microsoft Office Excel 2007 that use the Excel C 
> API. The C API enables DLLs to be integrated tightly with Excel 2007 and to 
> access the internal functionality in Excel. These DLL add-ins are known as 
> XLLs, given that they are usually given the file name extension .xll.
>  The primary reason for writing XLLs and using the C API is to create 
> high-performance worksheet functions. Although XLL functions are frequently 
> referred to as user-defined functions, the investment in time to obtain the 
> understanding and skills that are required to write XLLs make this a 
> technology impractical for most users. Nevertheless, the applications of 
> high-performance functions-and, in Excel 2007, the ability to write 
> multithreaded interfaces to powerful server resources-make it a very 
> important part of Excel extensibility. The performance of XLLs is further 
> enhanced in Excel 2007 by the addition of new data types and, most 
> important, support for multithreading.
>  The Excel 2007 XLL Software Development Kit contains a framework library 
> that is designed to speed up the writing of XLLs, and also three sample 
> projects.
> 
> -- 
> Danny Khen
> Excel Program Manager, Microsoft Corp.
> [To use my email address, replace (dot) and (at) with respective chars, and 
> (xxxx) with microsoft.com.]
> 
> ** This posting is provided "AS IS", with no warranties, and confers no 
> rights. ** 
> 
> 
0
Antony (12)
9/13/2007 6:00:03 PM
"Antony" <Antony@discussions.microsoft.com> wrote in message 
news:B1FF449A-23D6-4F18-BF19-EDE97C62D0BB@microsoft.com...
> Dear Danny,
>
>  Thank you for providing the new SDK.
>
>  The only thing that the SDK lacks is a decent object oriented framework
> wrapper. It would be nice to have some classes available which would hide 
> the
> complexity of memory management, working with specific data types
> (XLOPER/XLOPER12), registration/unregistration of
> UDFs/menus/commands/toolbars etc. The wrapper could take care of handling
> different Excel versions, working with Pascal-style strings, and many 
> other
> little but annoying things.
>
>  For an example of such a wrapper, please see http://xlw.sourceforge.net.
> This is an open source project which looks great, but which shouldn't be 
> used
> in a serious commercial project as it may contain unexpected bugs.

Please excuse me tooting my own horn here, but I have
such a product and am in the beta testing phase for the
latest version that solves some of the problems involved
in creating add-ins that work in Excel 2007 and older
versions. Anyone that is interested in being in the
program can e-mail info@kalx.net. Currently
there are only versions for VC++ 7.1 and 8.

Please see http://kalx.net/xll/README.htm for a description of
how to use the library. Note that the code you see there is all
that you need to create add-ins. All of the xlAuto* functions
are provided in xll.lib.

Keith A. Lewis 


0
kal (6)
9/13/2007 8:40:35 PM
Hi Antony

The second edition of my book, Financial applications using Excel add-in 
development in C/C++, published by Wiley, contains an example C++ class that 
wraps access, including all memory issues, to the XLOPER, the XLOPER12 and 
the Excel callbacks Excel4, Excel12 etc.  It also wraps access to strings, 
XLOPER arrays and supports the idea of XLLs being version-aware and 
thread-safe.  It is not held forward as a commercially robust piece of 
software, but there is plenty of discussion in the book about what such a 
class should do.  As an author, the quality threshhold you aim for is 
'bug-free', but that can't be a guarantee.  I do use it myself in a few 
projects in the field.

Steve

"Antony" <Antony@discussions.microsoft.com> wrote in message 
news:B1FF449A-23D6-4F18-BF19-EDE97C62D0BB@microsoft.com...
> Dear Danny,
>
>  Thank you for providing the new SDK.
>
>  The only thing that the SDK lacks is a decent object oriented framework
> wrapper. It would be nice to have some classes available which would hide 
> the
> complexity of memory management, working with specific data types
> (XLOPER/XLOPER12), registration/unregistration of
> UDFs/menus/commands/toolbars etc. The wrapper could take care of handling
> different Excel versions, working with Pascal-style strings, and many 
> other
> little but annoying things.
>
>  For an example of such a wrapper, please see http://xlw.sourceforge.net.
> This is an open source project which looks great, but which shouldn't be 
> used
> in a serious commercial project as it may contain unexpected bugs.
>
>  The old-style C API might be more efficient than the C++ wrapper, but
> using it in modern software projects is very counterproductive and error
> prone. I am sure most (if not all) C++ developers would be interested in
> having a C++ wrapper officially supported by Microsoft.
>
>  I've noticed that the new SDK includes two C++ classes, MemoryManager and
> MemoryPool, which is great! But the rest of things look like in the old 
> Excel
> 97 days -- that's 10 years ago..
>
>  Do you have any plans to provide a similar object oriented framework in
> the nearest future?
>
>  Thanks for your help!
>
> -- 
> Regards,
> Antony
>
>
> "Danny Khen [MSFT]" wrote:
>
>> The Microsoft Office Excel 2007 XLL Software Development Kit is out the 
>> door
>> at long last. Many Excel developers have been waiting for the new XLL SDK
>> for a long time now, since we released Office 2007 at the end of last 
>> year.
>> It took us longer than we had initially thought to update the SDK content
>> and develop the new documentation, but we hope that you will find the 
>> wait
>> was worthwhile, and will be satisfied with the quality of the final SDK
>> we've just released - the API files, the framework and code samples, and 
>> of
>> course the extensive and detailed documentation.
>>
>> Please find the new SDK here:
>> 1. Download:
>> http://www.microsoft.com/downloads/details.aspx?familyid=5272e1d1-93ab-4bd4-af18-cb6bb487e1c4&displaylang=en
>> 2. Online documentation:
>> http://msdn2.microsoft.com/en-us/library/bb687883.aspx
>>
>> Excerpt from the SDK documentation:
>>
>>  The Microsoft Office Excel 2007 XLL Software Development Kit is designed 
>> to
>> help you understand the relevant concepts and technologies that relate to
>> creating DLL add-ins for Microsoft Office Excel 2007 that use the Excel C
>> API. The C API enables DLLs to be integrated tightly with Excel 2007 and 
>> to
>> access the internal functionality in Excel. These DLL add-ins are known 
>> as
>> XLLs, given that they are usually given the file name extension .xll.
>>  The primary reason for writing XLLs and using the C API is to create
>> high-performance worksheet functions. Although XLL functions are 
>> frequently
>> referred to as user-defined functions, the investment in time to obtain 
>> the
>> understanding and skills that are required to write XLLs make this a
>> technology impractical for most users. Nevertheless, the applications of
>> high-performance functions-and, in Excel 2007, the ability to write
>> multithreaded interfaces to powerful server resources-make it a very
>> important part of Excel extensibility. The performance of XLLs is further
>> enhanced in Excel 2007 by the addition of new data types and, most
>> important, support for multithreading.
>>  The Excel 2007 XLL Software Development Kit contains a framework library
>> that is designed to speed up the writing of XLLs, and also three sample
>> projects.
>>
>> -- 
>> Danny Khen
>> Excel Program Manager, Microsoft Corp.
>> [To use my email address, replace (dot) and (at) with respective chars, 
>> and
>> (xxxx) with microsoft.com.]
>>
>> ** This posting is provided "AS IS", with no warranties, and confers no
>> rights. **
>>
>> 


0
Steve
9/14/2007 8:39:25 AM
Well, since everyone is touting their pet project, I might as well
jump in too ;-)

ExcelDna (http://groups.google.com/group/exceldna) is a wrapper of the
type Anthony refers to, but for integration with the .Net world. You
can make user-defined functions and macros in any .Net language (also
Visual Basic, for ease of porting your VBA code and skills, and
features like late-binding). Your library code can either be compiled
to a .dll or reside in a text-based script file that is dynamically
compiled and linked in. The only dependency on the client PC is
the .Net 2.0 runtime.

ExcelDna is built on the Excel XLL SDK interfaces, and I plan to
update it for the Excel 12 SDK in the next few months (depending on
user demand). Of course it already works in Excel versions from 97 to
2007, but integrating with the new SDK will give access to long,
Unicode strings, the large sheet, multithreading and the like. I
expect user add-ins to work transparently across versions.

User-defined functions in your library are automatically registered,
you can add custom descriptions categories and help, and menu entries
for your macros, and you never need to deal with an XLOPER again.
Function calls into Excel also dynamically translate the arguments -
just call Excel4/Excel12 with your .Net strings and ints - no memory
management hassles.

The performance of ExcelDna compares favourably with that of the C/C++
interface (seems like about 15% slower on the functions I use). And
the productivity boost from working in C# is awesome. Existing C/C++
libraries can still be called easily if some of the heavy lifting
really needs to be optimised (though .Net normally does a pretty good
job of numerical computations too).

ExcelDna is offered under a liberal open-source license, that
explicitly allows commercial use of the library.

In the announcement Danny states: "Although XLL functions are
frequently referred to as user-defined functions, the investment in
time to obtain the understanding and skills that are required to write
XLLs make this a technology impractical for most users." I think
ExcelDna is a greate start towards reviving true user-defined
functionality in the modern .Net environment. (I just need to add an
IDE - any volunteers?)

- Govert

0
govert (2)
9/15/2007 11:42:45 AM
Hi,

  Thank you everyone for your replies.

  Keith: Your project looks interesting, but to be clear, I am looking for 
something that covers all aspects of developing XLLs, something more 
high-level but also flexible enough. 

  To give you an idea:
  Imagine that you wish to obtain a reference to a currently selected range 
of cells in your XLL. To do this, you have to call Excel() with xlfSelection; 
if the call is successful, see whether it's xltypeRef, xltypeSRef, or maybe 
xltypeStr; if it's xltypeRef, you have to digg into the reference array 
(xloper.mref.lpmref->reftbl) and extract the information you need; and 
finally, you have to free memory.

  Now, imagine you could do just the same thing in a more elegant way:

  std::vector <CRef> x;
  if (Excel.Selection(&x) && x.size() > 0)
  {
    cout << "First row: " << x[0].RowFirst << endl;
  }
  else
  {
    // no luck
  }

  Another example:
  You do care about supporting international versions of Excel, so you need 
to obtain the decimal separator (which might be "." or "," etc.) for further 
float-to-string conversions in your add-in. Using the C API alone, the code 
would look like::

  xloper xSettings;

  // 37 means "A 45-item horizontal array of the items related 
  // to country versions and settings" (see Macrofun.hlp)
  if (Excel(xlfGetWorkspace, &xSettings, 1, TempNum(37)) == xlretSuccess)
  {
    // lparray[2] is a decimal separator;
    char *pascalStyleSeparator = xSettings.val.array.lparray[2].val.str;
    
    // convert pascalStyleSeparator to a C-style sting
    // ...

    Excel4(xlFree, 0, 1, &xSettings);
  }

  The same could look like:
 
  CString separator = Excel().GetWorkspace().Separator;
  
  That's how I imagine the C++ wrapper should work. Maybe I am asking for 
too much, but having such a framework available would be great.

  Steve: Your book is amazing, I look forward to purchasing the 2nd edition. 
Do you have any estimates on how many C++ XLL developers are out there - 
hundreds, thousands, more? I'd be very grateful if you could share this 
information. Thanks!

  Govert : ExcelDNA looks great, but I have chosen to use XLLs primarily due 
to performance considerations, and try to avoid using COM at all costs. 

-- 
Regards,
Antony


"Antony" wrote:

> Dear Danny,
> 
>   Thank you for providing the new SDK.
> 
>   The only thing that the SDK lacks is a decent object oriented framework 
> wrapper. It would be nice to have some classes available which would hide the 
> complexity of memory management, working with specific data types 
> (XLOPER/XLOPER12), registration/unregistration of 
> UDFs/menus/commands/toolbars etc. The wrapper could take care of handling 
> different Excel versions, working with Pascal-style strings, and many other 
> little but annoying things.
> 
>   For an example of such a wrapper, please see http://xlw.sourceforge.net. 
> This is an open source project which looks great, but which shouldn't be used 
> in a serious commercial project as it may contain unexpected bugs. 
> 
>   The old-style C API might be more efficient than the C++ wrapper, but 
> using it in modern software projects is very counterproductive and error 
> prone. I am sure most (if not all) C++ developers would be interested in 
> having a C++ wrapper officially supported by Microsoft.
> 
>   I've noticed that the new SDK includes two C++ classes, MemoryManager and 
> MemoryPool, which is great! But the rest of things look like in the old Excel 
> 97 days -- that's 10 years ago..
> 
>   Do you have any plans to provide a similar object oriented framework in 
> the nearest future?
> 
>   Thanks for your help!
> 
> -- 
> Regards,
> Antony
> 
> 
> "Danny Khen [MSFT]" wrote:
> 
> > The Microsoft Office Excel 2007 XLL Software Development Kit is out the door 
> > at long last. Many Excel developers have been waiting for the new XLL SDK 
> > for a long time now, since we released Office 2007 at the end of last year. 
> > It took us longer than we had initially thought to update the SDK content 
> > and develop the new documentation, but we hope that you will find the wait 
> > was worthwhile, and will be satisfied with the quality of the final SDK 
> > we've just released - the API files, the framework and code samples, and of 
> > course the extensive and detailed documentation.
> > 
> > Please find the new SDK here:
> > 1. Download: 
> > http://www.microsoft.com/downloads/details.aspx?familyid=5272e1d1-93ab-4bd4-af18-cb6bb487e1c4&displaylang=en
> > 2. Online documentation: 
> > http://msdn2.microsoft.com/en-us/library/bb687883.aspx
> > 
> > Excerpt from the SDK documentation:
> > 
> >  The Microsoft Office Excel 2007 XLL Software Development Kit is designed to 
> > help you understand the relevant concepts and technologies that relate to 
> > creating DLL add-ins for Microsoft Office Excel 2007 that use the Excel C 
> > API. The C API enables DLLs to be integrated tightly with Excel 2007 and to 
> > access the internal functionality in Excel. These DLL add-ins are known as 
> > XLLs, given that they are usually given the file name extension .xll.
> >  The primary reason for writing XLLs and using the C API is to create 
> > high-performance worksheet functions. Although XLL functions are frequently 
> > referred to as user-defined functions, the investment in time to obtain the 
> > understanding and skills that are required to write XLLs make this a 
> > technology impractical for most users. Nevertheless, the applications of 
> > high-performance functions-and, in Excel 2007, the ability to write 
> > multithreaded interfaces to powerful server resources-make it a very 
> > important part of Excel extensibility. The performance of XLLs is further 
> > enhanced in Excel 2007 by the addition of new data types and, most 
> > important, support for multithreading.
> >  The Excel 2007 XLL Software Development Kit contains a framework library 
> > that is designed to speed up the writing of XLLs, and also three sample 
> > projects.
> > 
> > -- 
> > Danny Khen
> > Excel Program Manager, Microsoft Corp.
> > [To use my email address, replace (dot) and (at) with respective chars, and 
> > (xxxx) with microsoft.com.]
> > 
> > ** This posting is provided "AS IS", with no warranties, and confers no 
> > rights. ** 
> > 
> > 
0
Antony (12)
9/17/2007 11:26:01 AM
>   Govert : ExcelDNA looks great, but I have chosen to use XLLs primarily due
> to performance considerations, and try to avoid using COM at all costs.

Hi Anthony,

Just to be clear: ExcelDna is built on the XLL interface, and does not
use the Excel COM integration at all. As a result, the performance of
managed code running on ExcelDna is similar to native XLL add-ins,
with at most some tens of processor instructions per function call
overhead for the unmanaged->managed->unmanaged transitions.

Regards,
Govert

0
govert (2)
9/17/2007 12:36:40 PM
"Antony" <Antony@discussions.microsoft.com> wrote in message 
news:DACD2933-6029-4774-A53A-6C7841ACC534@microsoft.com...
> Hi,
>
>  Thank you everyone for your replies.
>
>  Keith: Your project looks interesting, but to be clear, I am looking for
> something that covers all aspects of developing XLLs, something more
> high-level but also flexible enough.

You'll have to look at it and decide if it fits your needs.

>  Now, imagine you could do just the same thing in a more elegant way:
>
>  std::vector <CRef> x;
>  if (Excel.Selection(&x) && x.size() > 0)
>  {
>    cout << "First row: " << x[0].RowFirst << endl;
>  }
>  else
>  {
>    // no luck
>  }

Using my XLL library you would get the xltypeMulti
corresponding to the selection using:

  OPER x = Excel(xlCoerce, Excel(xlfSelection));

No memory leaks.An exception is throw if something fails.
Elements are accessed linearly using operator[] and 2d
using operator().

  >  Another example:
>  You do care about supporting international versions of Excel, so you need
> to obtain the decimal separator (which might be "." or "," etc.) for 
> further
> float-to-string conversions in your add-in. Using the C API alone, the 
> code
> would look like::
>
>  xloper xSettings;
>
>  // 37 means "A 45-item horizontal array of the items related
>  // to country versions and settings" (see Macrofun.hlp)
>  if (Excel(xlfGetWorkspace, &xSettings, 1, TempNum(37)) == xlretSuccess)
>  {
>    // lparray[2] is a decimal separator;

ITYM 3, not 2.

>    char *pascalStyleSeparator = xSettings.val.array.lparray[2].val.str;
>
>    // convert pascalStyleSeparator to a C-style sting
>    // ...
>
>    Excel4(xlFree, 0, 1, &xSettings);
>  }
>
>  The same could look like:
>
>  CString separator = Excel().GetWorkspace().Separator;

My way:

  string separator = String(Excel(xlfGetWorkspace, Num(37))[3]);

Again, no memory leaks and throws if something unexpected happens.

My philosophy is to use thin wrappers around the Excel SDK, not
rewrite my own that I have to test and document, or even worse,
that I have to design and then convince others is the "right" way.

>  That's how I imagine the C++ wrapper should work. Maybe I am asking for
> too much, but having such a framework available would be great.

Sometimes you just have to work with what you got.I've found that
people having some experience with the raw SDK don't believe it is
possible to make it as simple as my library makes it. All I can say is
try it. mailto:info@kalx.tex

Keith A. Lewis | KALX, LLC | http://kalx.net

440 Ninth Ave., 8th Floor | New York, NY 10001

Phone: 212.404.2311 | Fax: 212.404.3228




0
kal (6)
9/17/2007 5:07:47 PM
Govert,

Sorry, I meant managed code. I think ExcelDNA only works with .NET? I've got 
a lot of code written in pure C/C++ so there's no good reason to use .NET.

-- 
Regards,
Antony


"Govert van Drimmelen" wrote:

> >   Govert : ExcelDNA looks great, but I have chosen to use XLLs primarily due
> > to performance considerations, and try to avoid using COM at all costs.
> 
> Hi Anthony,
> 
> Just to be clear: ExcelDna is built on the XLL interface, and does not
> use the Excel COM integration at all. As a result, the performance of
> managed code running on ExcelDna is similar to native XLL add-ins,
> with at most some tens of processor instructions per function call
> overhead for the unmanaged->managed->unmanaged transitions.
> 
> Regards,
> Govert
> 
> 
0
Antony (12)
9/17/2007 6:26:06 PM
Keith,

  Thanks for your reply.

>> // 37 means "A 45-item horizontal array of the items related
>> // to country versions and settings" (see Macrofun.hlp)
>> if (Excel(xlfGetWorkspace, &xSettings, 1, TempNum(37)) == xlretSuccess)
>> {
>> // lparray[2] is a decimal separator;

>ITYM 3, not 2.

No, I meant 2 - the C array is zero-based.

> My philosophy is to use thin wrappers around the Excel SDK, 
> not rewrite my own that I have to test and document, or even
> worse, that I have to design and then convince others is the 
> "right" way.

I think there is no "right" way really. You can just hide the complexity of 
handling all these little things (like the array index - 3 or 2? I had to 
test it..) in a way similar to how Microsoft's MFC and Borland's VCL hide the 
complexity of dealing with WinAPI. That's not like you are rewriting the core 
SDK - you're just providing a *little bit* thicker wrapper and a *much more* 
easy, productive, safe and intuitive way to develop add-ins. 

  Thanks again for taking your time.

-- 
Regards,
Antony


"Keith A. Lewis" wrote:

> "Antony" <Antony@discussions.microsoft.com> wrote in message 
> news:DACD2933-6029-4774-A53A-6C7841ACC534@microsoft.com...
> > Hi,
> >
> >  Thank you everyone for your replies.
> >
> >  Keith: Your project looks interesting, but to be clear, I am looking for
> > something that covers all aspects of developing XLLs, something more
> > high-level but also flexible enough.
> 
> You'll have to look at it and decide if it fits your needs.
> 
> >  Now, imagine you could do just the same thing in a more elegant way:
> >
> >  std::vector <CRef> x;
> >  if (Excel.Selection(&x) && x.size() > 0)
> >  {
> >    cout << "First row: " << x[0].RowFirst << endl;
> >  }
> >  else
> >  {
> >    // no luck
> >  }
> 
> Using my XLL library you would get the xltypeMulti
> corresponding to the selection using:
> 
>   OPER x = Excel(xlCoerce, Excel(xlfSelection));
> 
> No memory leaks.An exception is throw if something fails.
> Elements are accessed linearly using operator[] and 2d
> using operator().
> 
>   >  Another example:
> >  You do care about supporting international versions of Excel, so you need
> > to obtain the decimal separator (which might be "." or "," etc.) for 
> > further
> > float-to-string conversions in your add-in. Using the C API alone, the 
> > code
> > would look like::
> >
> >  xloper xSettings;
> >
> >  // 37 means "A 45-item horizontal array of the items related
> >  // to country versions and settings" (see Macrofun.hlp)
> >  if (Excel(xlfGetWorkspace, &xSettings, 1, TempNum(37)) == xlretSuccess)
> >  {
> >    // lparray[2] is a decimal separator;
> 
> ITYM 3, not 2.
> 
> >    char *pascalStyleSeparator = xSettings.val.array.lparray[2].val.str;
> >
> >    // convert pascalStyleSeparator to a C-style sting
> >    // ...
> >
> >    Excel4(xlFree, 0, 1, &xSettings);
> >  }
> >
> >  The same could look like:
> >
> >  CString separator = Excel().GetWorkspace().Separator;
> 
> My way:
> 
>   string separator = String(Excel(xlfGetWorkspace, Num(37))[3]);
> 
> Again, no memory leaks and throws if something unexpected happens.
> 
> My philosophy is to use thin wrappers around the Excel SDK, not
> rewrite my own that I have to test and document, or even worse,
> that I have to design and then convince others is the "right" way.
> 
> >  That's how I imagine the C++ wrapper should work. Maybe I am asking for
> > too much, but having such a framework available would be great.
> 
> Sometimes you just have to work with what you got.I've found that
> people having some experience with the raw SDK don't believe it is
> possible to make it as simple as my library makes it. All I can say is
> try it. mailto:info@kalx.tex
> 
> Keith A. Lewis | KALX, LLC | http://kalx.net
> 
> 440 Ninth Ave., 8th Floor | New York, NY 10001
> 
> Phone: 212.404.2311 | Fax: 212.404.3228
> 
> 
> 
> 
> 
0
Antony (12)
9/17/2007 7:00:00 PM
"Antony" <Antony@discussions.microsoft.com> wrote in message 
news:85A1E94D-0043-406D-AB67-12E5C429D478@microsoft.com...
> Keith,
....
>>ITYM 3, not 2.
>
> No, I meant 2 - the C array is zero-based.
....
You are correct. My mistake.

>> My philosophy is to use thin wrappers around the Excel SDK,
>> not rewrite my own that I have to test and document, or even
>> worse, that I have to design and then convince others is the
>> "right" way.
>
> I think there is no "right" way really. You can just hide the complexity 
> of
> handling all these little things (like the array index - 3 or 2? I had to
> test it..) in a way similar to how Microsoft's MFC and Borland's VCL hide 
> the
> complexity of dealing with WinAPI. That's not like you are rewriting the 
> core
> SDK - you're just providing a *little bit* thicker wrapper and a *much 
> more*
> easy, productive, safe and intuitive way to develop add-ins.

Good points. It is certainly possible to make the arrays
1-based in the C++ wrapper, but then you might make the
opposite mistake when you have your C++ cap on.0-based
seems right to me.

What you want does not exist. What I have is very
close to what you seem to be describing in terms of
the actual number of characters you need to type in
order to produce the functionality specified in your
two examples. If you want to hold out for someone to
write Excel().GetWorkspace().Separator (or should
that be .DecimalSeparator?) and hundreds of
similar functions, that's your choice. If you can live with
String(Excel(xlfGetWorkspace, Num(37))[2]),  and have full
access to all of the API, you can get your job done today.

I've solved all the fundamental problems for you: make
it trivial to register functions and macros, have C++
versions of OPER's that work how you expect a variant
to work, handle memory management for Excel4 calls, and
even provide simple ways to hook into xlAuto* and xlOn*
functions. You have the easy and fun part of deciding what
kind of training wheels you want to bolt on the side.

This is the sixth version of the library I've written from
the ground up. I think I'm getting pretty good at it now.
I use earlier versions for the Excel work I do consulting
for hedge funds. Since this version is the first one
designed for Excel 2007, I'm looking for beta testers
before using it in production.

This version of the library addresses some of the issues
involved with writing Excel 2007 macros. In particular,
it allows one to write one set of source code that can be
compiled for either Excel 2007 or older versions, much
like the unicode/non unicode method Microsoft employs.

It also makes it possible to write one set of code that
runs in either environment and takes advantage of the new
SDK features when run in Excel 2007.

If you're a good beta tester, I might even port my menu
and dialog classes over that make it simple to write these
and have them interact properly with Excel. But you have
to actually use and look at the code I wrote.  Feel free
to point out where it does not meet your functional
requirements.

No promises on your esthetic requirements. :-)

mailto:info@kalx.net

Keith A. Lewis | KALX, LLC | http://kalx.net
440 Ninth Ave., 8th Floor | New York, NY 10001
Phone: 212.404.2311 | Fax: 212.404.3228 


0
kal (6)
9/17/2007 8:35:23 PM
Keith,
There is no need to redistribute those files; users don't need them. All you 
need to deploy is the XLL that you come up with; you need the API files to 
compile and link, but the XLL doesn't need them in runtime on the user's 
machine.

In terms of the SDK itself (for developers), anyone can download and use the 
SDK for free, but we want them to get it from us. I think that's what the 
legal language means. Does this make sense?

-- 
Danny Khen
Excel Program Manager, Microsoft Corp.
[To use my email address, replace (dot) and (at) with respective chars, and 
(xxxx) with microsoft.com.]

** This posting is provided "AS IS", with no warranties, and confers no 
rights. **
"Keith A. Lewis" <kal@kalx.net> wrote in message 
news:ONPiRtV9HHA.1168@TK2MSFTNGP02.phx.gbl...
> According the the SDK Redist License Terms, it seems xlcall.h, xlcall.cpp, 
> and xlcall32.lib
> are not redistributable. I hope I'm wrong, but if not, is the appropriate 
> way of providing these
> is to have users download and install the Microsoft SDK?
>
> Thanks,
> Keith A. Lewis
> 

0
Danny
9/18/2007 2:07:24 AM
We don't have current plans to enhance XLLs with an OO interface. In 
general, for us to invest in a new OM, we have to consider the broader 
context of Excel client + Excel Services. The server does not support XLLs, 
so the first consideration would need to be - do we add that support? If we 
don't - does it make sense for us to invest in a new framework that's good 
only for the client? As you can imagine, we're constantly evaluating this 
and other questions, and we have to take strategic approaches, which would 
make sense long term, would be easy to support, to develop against, would 
make sense as part of Microsoft's and Office's overall programmability 
story, etc. There is nothing short-term that I can share unfortunately.

There are many 3rd-party solutions, some of them discussed on this thread, 
that can be used right now.

-- 
Danny Khen
Excel Program Manager, Microsoft Corp.
[To use my email address, replace (dot) and (at) with respective chars, and 
(xxxx) with microsoft.com.]

** This posting is provided "AS IS", with no warranties, and confers no 
rights. **
"Antony" <Antony@discussions.microsoft.com> wrote in message 
news:B1FF449A-23D6-4F18-BF19-EDE97C62D0BB@microsoft.com...
> Dear Danny,
>
>  Thank you for providing the new SDK.
>
>  The only thing that the SDK lacks is a decent object oriented framework
> wrapper. It would be nice to have some classes available which would hide 
> the
> complexity of memory management, working with specific data types
> (XLOPER/XLOPER12), registration/unregistration of
> UDFs/menus/commands/toolbars etc. The wrapper could take care of handling
> different Excel versions, working with Pascal-style strings, and many 
> other
> little but annoying things.
>
>  For an example of such a wrapper, please see http://xlw.sourceforge.net.
> This is an open source project which looks great, but which shouldn't be 
> used
> in a serious commercial project as it may contain unexpected bugs.
>
>  The old-style C API might be more efficient than the C++ wrapper, but
> using it in modern software projects is very counterproductive and error
> prone. I am sure most (if not all) C++ developers would be interested in
> having a C++ wrapper officially supported by Microsoft.
>
>  I've noticed that the new SDK includes two C++ classes, MemoryManager and
> MemoryPool, which is great! But the rest of things look like in the old 
> Excel
> 97 days -- that's 10 years ago..
>
>  Do you have any plans to provide a similar object oriented framework in
> the nearest future?
>
>  Thanks for your help!
>
> -- 
> Regards,
> Antony
>
>
> "Danny Khen [MSFT]" wrote:
>
>> The Microsoft Office Excel 2007 XLL Software Development Kit is out the 
>> door
>> at long last. Many Excel developers have been waiting for the new XLL SDK
>> for a long time now, since we released Office 2007 at the end of last 
>> year.
>> It took us longer than we had initially thought to update the SDK content
>> and develop the new documentation, but we hope that you will find the 
>> wait
>> was worthwhile, and will be satisfied with the quality of the final SDK
>> we've just released - the API files, the framework and code samples, and 
>> of
>> course the extensive and detailed documentation.
>>
>> Please find the new SDK here:
>> 1. Download:
>> http://www.microsoft.com/downloads/details.aspx?familyid=5272e1d1-93ab-4bd4-af18-cb6bb487e1c4&displaylang=en
>> 2. Online documentation:
>> http://msdn2.microsoft.com/en-us/library/bb687883.aspx
>>
>> Excerpt from the SDK documentation:
>>
>>  The Microsoft Office Excel 2007 XLL Software Development Kit is designed 
>> to
>> help you understand the relevant concepts and technologies that relate to
>> creating DLL add-ins for Microsoft Office Excel 2007 that use the Excel C
>> API. The C API enables DLLs to be integrated tightly with Excel 2007 and 
>> to
>> access the internal functionality in Excel. These DLL add-ins are known 
>> as
>> XLLs, given that they are usually given the file name extension .xll.
>>  The primary reason for writing XLLs and using the C API is to create
>> high-performance worksheet functions. Although XLL functions are 
>> frequently
>> referred to as user-defined functions, the investment in time to obtain 
>> the
>> understanding and skills that are required to write XLLs make this a
>> technology impractical for most users. Nevertheless, the applications of
>> high-performance functions-and, in Excel 2007, the ability to write
>> multithreaded interfaces to powerful server resources-make it a very
>> important part of Excel extensibility. The performance of XLLs is further
>> enhanced in Excel 2007 by the addition of new data types and, most
>> important, support for multithreading.
>>  The Excel 2007 XLL Software Development Kit contains a framework library
>> that is designed to speed up the writing of XLLs, and also three sample
>> projects.
>>
>> -- 
>> Danny Khen
>> Excel Program Manager, Microsoft Corp.
>> [To use my email address, replace (dot) and (at) with respective chars, 
>> and
>> (xxxx) with microsoft.com.]
>>
>> ** This posting is provided "AS IS", with no warranties, and confers no
>> rights. **
>>
>> 

0
Danny
9/18/2007 2:16:33 AM
"Danny Khen [MSFT]" <Danny (dot) Khen (at) (xxx)> wrote in message 
news:eUqboiZ%23HHA.1484@TK2MSFTNGP06.phx.gbl...
> Keith,
> There is no need to redistribute those files; users don't need them. All 
> you need to deploy is the XLL that you come up with; you need the API 
> files to compile and link, but the XLL doesn't need them in runtime on the 
> user's machine.
>
> In terms of the SDK itself (for developers), anyone can download and use 
> the SDK for free, but we want them to get it from us. I think that's what 
> the legal language means. Does this make sense?

Completely. Thanks for the clarification, Danny. 


0
kal (6)
9/19/2007 9:16:43 PM
We have recently released a new version of Excel4Net v2.0 - the RAD kit for creating Excel spreadsheet applications and add-ins using the .NET framework.

To download a free fully functionally beta version please go to www.excel4net.com/Download.aspx


Key features:

*Easy to use
*Works with VBA and with in-cell functions
*Uses a simple deployment model
*Makes it easy to test and debug your spreadsheet and .NET code
*Have a built-in monitoring and performance profiling capabilities
*Supports users remotely
*Generates documentation for your code
*Runs on Excel 2002, 2003 and 2007, .NET 2.0, 3.0 and 3.5

"Getting started" documentation: http://excel4net.com/Documentation.aspx

"Quick overview" page: http://excel4net.com/Overview.aspx

Download link: http://excel4net.com/Download.aspx
0
Excel
12/28/2008 1:48:48 PM
Reply:

Similar Artilces:

spread sheets from excel 2003 don't format right in excel 2007
When I recieve a spread sheet that was done on excel 2003 it doesn't look right in excel 2007 the fonts are changed text boxes are out of place images don't form correctly. I have tried evert way to sae it but it still won't work correctly? I would suggest asking in an Excel newsgroup. This is an Access newsgroup. Access is a database application. -- Hope that helps! RBear3 .. "Excel issues" <Excel issues @discussions.microsoft.com> wrote in message news:87DFFCE6-FC8A-4853-8609-4AE54AF20618@microsoft.com... > When I recieve a spread sheet that was done...

Excel 2003 issue with Windows XP Pro SP-2
Hi Folks, I saw that this question had been posted by many people already, but I could not find an answer for the same. I am using Windows XP Pro Service pack 2 and Office 2003. Scenario 1) I have a hyper link in a web page that opens up an Excel document. When I click the link, I get the IE dialogue box with "Open' and "Save" options. After that, if I click "open" it opens the Excel Window without any data in it, but with an error message telling that -- 'C:\Documents and *****\--\--\abcd.xls' could not be found. Check the spelling of the file name and ...

2 users using Outlook 2007 in Win7
I am trying to set up OUTLOOK 2007 on a 2nd account on my computer. I am the administrator. I open the 2nd account on my Win7 machine. I open MSOFFICE, select Outlook 2007. The program shows the migration window, but then errors as follows: "Cannot open default e-mail folders. File access denied. You do not have permission required to access C:\users\owner\appdata\local\microsoft\outlook\outlook.pst". I had 2 user accounts in XP and was using Outlook in both accounts. When I transferred to Win7, I an able to successfully use Outlook on one account, but need to set up ...

help in excel
Someone please help me, I have 50,000.00 names and addresses in columns I need t put them in rows -- Message posted from http://www.ExcelForum.com Copy the columns and transpose those data into a row (right click your mouse and choose). hope this helps. The following MSKB article has instructions for that: Converting Multiple Rows/Columns to Columns/Rows http://support.microsoft.com/default.aspx?id=116289 jeanettesalinas < wrote: > I have 50,000.00 names and addresses in columns I need to > put them in rows. > -- Debra Dalgleish Excel FAQ, Tips & Book List http...

Linking totals in Excel
I want to link totals from a spreadsheet to a summary total block. I would like to structure the detail totals to take care of all possible categories. (One summary total for each category). The detail data from this weeks spreadsheet may not contain data for all categories. How can I have a "place holder for each total"? Next week the summary total that was empty will be full. I have used nested sub totals but can't figure out how to link those without doing it every time the weekly spread is run. if ;you click edit-copy a cell(e.g A1) and then go to another cell (e.g. F...

SBS 2003, ActiveSync, and Excel files questions
Hello! I am not sure which newsgroup to use for this one. I have SBS 2003 SP1 with Exchange SP2 and XP SP2 workstations. I just bought a new phone with WM6 on it and ActiveSync works great for Exchange stuff, but I have a problem with Excel files. I have a spreadsheet for my mileage that is in Excel 2003 format. I used to use it with my ancient Palm m130 and Dataviz Documents to Go, which I have removed from my computer. Every time I sync the Excel file to my desktop using ActiveSync, I can then edit it on my workstation normally, but when I edit it on the phone and try to save it, it...

[ANN] Liquid XML Studio 2009 SP1 Released
Liquid Technologies are pleased to announce the release of Liquid XML Studio 2009 Service Pack 1. As well as fixing bugs and incorporating user feedback, Service Pack 1 also adds a Graphical XML Grid View, allowing users to view and edit XML Data as a tabular or tree structure, see http://www.liquid-technologies.com/XmlStudio/Free-Xml-Editor.aspx New Features - Graphical XML Grid Editor - Source Control Integration - Graphical XSD Editor Redo - XSD Annotations Dialog - Graphical XSD Editor Tooltips XML Data Binding Enhancements - Runtimes for Compact Framework Net 2.0 & 3.5 - Add...

Excel VBA #4
I'm very new to VBA and could use a little help. I wrote a macro that does the following: First Part: Unprotects the sheet; then does a file Save As to a specific folder and then goes to Cell P2. All is fine except the macro didn't record the password and I have to type it in everytime. So it's prompting me for the password everytime. During the file Save As operating, it says such & such file already exists, do you want to replace? The answer is always going to be YES. How do i make that happen? Second Part: Once Cell P2 is activated, I type in a code (number) for that...

How to pull data from Access from within Excel?
I have an Access database I use to create a job quotation # and assign a project name to. I also use Excel to keep track of the hours worked on each project. What I'd like to do is create an employee time sheet in Excel and just enter his daily hours along with the job quotation # and have Excel automatically pull the job name from the Access quotation database. Can anyone help me with a sample or a direct me to a site that will show me how I can do this... I'm not an expert in either software but if i see a sample, i usually can modify it for my use. Thanks folks! Excel has a da...

only 34 more days 2 go until the mentally challenged Kevin Panzke finishes this round of Ubuntu 10.04 countdown. Just FYI
Just FYI ...

Just off the Press ....Explosive
Just off the Press ..Explosive Customer Building Techniques New toolkit reveals 26 Explosive Customer Building techniques that will produce ready to buy subscribers, as much as 50 times faster than most other conventional methods. (there is a 100% quadruple money back guarantee - yes quadruple, you'll be amazed) Just imagine all the money you could make. You can use your money for whatever you like. Buy yourself (or the kids) an education, buy or pay off your House or Car. Donate some or all of your newly earned wealth to your favorite charity. To learn more go to: http://50000custom...

Dates in Excel #7
I want to assign the value '10' to any date vbetween 6/10/2004 and 8/11/2004 and then follow on in that date sequence with the values '11' , '12' and so on. But how?!!! I have tried all the date functions but they appear to want to remain logical to the real date whereas I want to use periods of time to give a certain value. Will ...

Excel VBA
Hi, How to import text file to Excel worksheet using VB? Can I use a for menu to execute this process? Please give me some ideas of doing it. have attached a text file for your reference. Thanks! AN -- Message posted from http://www.ExcelForum.com >>How to import text file to Excel worksheet using VB? Record a macro as you do it manually with File, Open. Pick the appropriate file type from the drop down. That will give you a good start. >>Can I use a form menu to execute this process? form menu? No such thing. -- Jim Rech Excel MVP "annsmjarm >" <<an...

Where can I find a Billing Statement Template for Word or Excel?
You could try something like this: http://www.officearticles.com/tutorials/order_form_or_invoice_form_in_microsoft_excel.htm ******************* ~Anne Troy www.OfficeArticles.com "Iltid" <Iltid@discussions.microsoft.com> wrote in message news:A72C5928-9C02-4F6F-8004-9ABE807F7CA8@microsoft.com... > Take a look here: http://office.microsoft.com/en-us/templates/CT011377071033.aspx ...

Importing Netscape 7.1 mail and addresses into Office Outlook 2007
How do I import mail folders and addresses from Netscape 7.1 into Office Outlook 2007? The latter does not seem to inherently recognize the former. I'm new to this forum; sorry if I'm asking something that's been covered a thousand times.....just steer to me to the closest link. Thanks. does netscape support exporting addresses to csv format? http://www.slipstick.com/config/convaddr.htm - address magic plus will do both the addresses and the messages. -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Need Help with Common Tasks? http://www....

Import from Excel into Money
My 401k administrator has a web site where I can get a list of transactions, but they don't have a way to export directly to money. Is there a way I can import an excel file of these transactions into money. Help files and the MS web site have NOTHING on the subject. Any help would be appreciated. Jay Well, this group addresses it at least weekly and sometimes daily. You could read more headers or search the group archives at http://groups.google.com. Finally, you could read the FAQ at http://www.bollar.org/msmoney. In particular, please read http://www.bollar.org/msmoney/#Q8. &qu...

How to store Metadata in the Excel Sheet (2000, XP, 2003)
I'm trying to find some way to store Metadata inside the Excel Shett. I am looking solution for Excel 2000, XP, 2003 versions. The only way I found is to save it in Custom Properties, but it have size limitation to 255 characters, so it not useful for me. In Word document I found something calls Variable, which solves me the problem. Is exist similar solution for Excel? It can be different solution for different Excel versions. I'm programming in C# with Office Object Model P.S I'm looking for same solution in PowerPoint presentation too. Thanks. See response in prog...

importing forms in Excel
I've made an "on-line" form template in Word (Office 2000)and now have several documents filled out with client info. Is there a way to import data from these multiple form documents into a single Excel database/spreadsheet? I need to share the Form documents with others as email attachments so I can't use Access because the others don't have Access. Thanks. If you create a form in Word, you can set it to save the Data only (Tools>Options, Save tab, 'Save Data only for forms'). This will create a text file when you save it. You can import the text files t...

Publisher 2007 won't save whole document
I am importing a long word document into publisher 2007 in order to make it into a booklet. I import about 200 pages. I can reformat it fine, and then when I save it, only 9 pages save properly. A few pictures save on some other pages scattered throughout. I have done it several times. Only the first 9 pages ever save correctly. HELP! -- Roberto Try this, page setup, booklet, create a text box on the page where you want the text to begin, select the text box, right-click, click change text, click text file, browse to the Word document. Publisher will create pages and text boxes. Two-h...

security update for excel 2003 unsuccessful (KB982311)
Everytime I install this update, the computer will reboot but then I get prompted to install again. I've registered wuaus2.dll w/ no luck. Please help. Tip: Insert your Office CD into the appropriate drive bay before the next installation attempt. Tip: Access the following KB article via IE (32-bit) only, run the Fix It & reboot before the next installation attempt: http://support.microsoft.com/kb/886549 [ignore the title, error number, etc.] Tip: If no joy, see if you can download the "fullfile" version of the update(s) via http://www.microsoft.com/do...

How do I alpha my mailing list in Microsoft excel and delete names
To alphabetize -- use sort Sorting, Some notes on sorting in Excel http://www.mvps.org/dmcritchie/excel/sorting.htm To delete rows pick a range of rows by selecting one or more contiguous row number(s) then Edit, Delete rows You might also be interested in Filtering to expose only names in Ohio You can use Filtering to permanently delete rows or just hide them. you can read more about filtering at http://www.contextures.com/tiptech.html If you want to print labels for your mailing list, you do the printing in MS Word with Excel acting as your data bas...

Excel and the Math Coprocessor for DLLs
I have a large Win32 DLL (10 MB) that is called from my user interface (written in C++) or from VBA in MS Excel. In my user interface, the DLL runs in its own space and calculates correctly. Under Excel VBA, my DLL is having problems with double precision accuracy. The following test passes in my user interface but fails under my bad pentium test: double precision chptst double precision divtwo double precision top double precision bottom data top / 4195835.0D0 / data bottom / 3145727.0D0 / DIVTWO = top / bottom CHPTST = (DIVTWO * bot...

suddenly when i use formula it just show
pls help me on this, somehow when i use formula, to link to existing box with formula, the result will be 0. plss help it kind of urgent here... Try to explain in a little different way please. ...

just for testing
0oi[- ...

Converting an Excel file to fixed length ASCII (text) file
I would like to convert an Excel table to a fixed length ASCII file for data transfer. Is this possible with Excel XP or an available download? File/Save As and select the type Formatted Text (space delimited) (.prn) Beware of the following caveats (from Help for XL 2002). I have no idea what they mean by "Columns of data are separated by commas". If these limitations affect you, you may need to write VBA code to create your text file. That would not be limited to 240-character lines. "The Formatted Text (*.prn) format saves only the text and values as they are displayed in...