User forums > Using Code::Blocks

Building Excel .xll addins with Code::Blocks & MingW

<< < (2/3) > >>

Hi Cacb,

XLW is specifically for writing Excel addins (.xlls). XLW allows you to write an xll as easy as is demonstrated in the clip instead of having to do it the traditional way :

and I can tell you from years experience ... the traditional method is frustrating and error-prone.
XLW could be used to read and write .xls files, but it would require some work and some advanced knowledge of the Excel SDK.
In future versions ox XLW we plan on doing some of this work for the user by providing some extra functionality, but unlikey we will go all the way for the user not to require some explicit knowledge of the Excel SDK.

There are various propriety apps to aide building xlls, but they can be more than I am willing to pay or contain too much code that I am not permitted to change or see ;-)



--- Quote from: Ninds on June 21, 2009, 09:13:18 am ---XLW could be used to read and write .xls files, but it would require some work and some advanced knowledge of the Excel SDK.

--- End quote ---
Hello Ninds,

Ok, I have been looking for simple ways to write data from a wxWidgets application to be viewed by Excel. So far I only use .CSV files, but then you cannot write multiple worksheets. Maybe it would be an idea to extend XLW for such use also.

Thanks for your work!


Modern versions of Excel spreadsheets are xml so if your content with producing the newer formats of spreadsheets then what you ask for is much easier. Moreover you will probably find more information on the web about creating Excel spreadsheets ( xml type) in C#.
Have you considered .odf, there are downloads for Excel which allow the use of the .odf format , moreover its compatible with Openoffice.


When the building a template xll with Code::Blocks & XLW ( v Beta0, xlw4.0.0b0 )  the following compilation error has been reported:

--- Code: ----------------- Build: Debug in Template ---------------
Running target pre-build steps
make -f RunInterfaceGenerator.mak
Execution of 'make -f RunInterfaceGenerator.mak' in 'C:\Documents and Settings\Raphael Halim Lie\My Documents\XLL_Project' failed.
Nothing to be done.

--- End code ---

This problem will be resolved in the final release. For now here is a fix

* Goto the MinGW/bin directory ( whether in the free standing MinGW install or in C:\Program Files\CodeBlocks\MinGW which ever you are using ) and make a copy of the file 'mingw32-make.exe' into the same directory but name it 'make.exe'
* Open up Code::Blocks and goto  'Settings -> Compiler and debugger' and  press on 'Reset Default', continuing to confirm
* Make sure the MinGW/bin directory is on your path.
If any other issues are observed please post to xlw-users mailing list or ( if it's ok with the administrator here ) post it here.


Recently MinGW has updated its GCC compiler suite to GCC4.4.0 The new version of XLW ( 4.0.0 beta 1 ), released today has been updated to reflect this change in MinGW. The dependency in XLW on the earlier version of GCC (3.4.5) has been replaced by the dependency on the newer GCC shipped with the latest MinGW GCC4.4.0

Unfortunatley the MinGW automatic installer has not been updated to install the new compiler suite and if used for installation will still install the older GCC, with which XLW will no longer work ( unless compiled from source). In this case the normal way around would be to install MinGW manualy without the automatical installer, however this can be somewhat tedious.

In order to keep the installation, usage and overall experience of XLW simple and painless we have built a MinGW installer that will download and install all the necessary MinGW components required for C/C++ compilation and resolve XLW's dependency.

You will find the MinGW installer, 'xlw-MinGW-Installer.exe' on the xlw sourceforge page ( under the download section for 'xlw-MingW-Installer'. This will install GCC4.4 & MSYS (from the official MinGW download site) and put the appropriate bin directories on the PATH. It is however not necessary to use this installer to get the latest version of MinGW, the TDM installer can be found here :


If you do not already have Code::Blocks installed then on the Code::Blocks download site there are 2 installers available. One with MinGW and one without. Previously it was advised to install the one with the MinGW. However now you should install the one WITHOUT MinGW, since the MinGW packaged in the Code::Blocks installer is the older version. Code::Blocks should be installed after MinGW has been installed.

If you already have Code::Blocks installed then install the latest MinGW ( GCC4.4 ) as described above. Then in Code::Blocks goto

              Settings->Compiler & Debugger -> Toolchain executables

and set the Compilers installation directory to the bin directory of your new MinGW installation (if you used the xlw MinGW installer and installed to the default directory, this should be C:\GNU\MinGW\bin)

Please let us know if there are any problems.



[0] Message Index

[#] Next page

[*] Previous page

Go to full version