Author Topic: Building Excel .xll addins with Code::Blocks & MingW  (Read 27840 times)

Offline Ninds

  • Multiple posting newcomer
  • *
  • Posts: 18
Building Excel .xll addins with Code::Blocks & MingW
« on: May 16, 2009, 09:59:11 pm »
Hello
There is a release ( be it an alpha ) of xlw that now supports building Excel addins ( .xlls ) with Code::Blocks ( MingW ).
Upto now XLW has only had  support for Dev-C++.  I am discussing deprecating Dev-C++ support in favour of Code::Blocks.
Any feedback from Code:Blocks users would be very helpful.
The xlw sourceforge page is at :   https://sourceforge.net/projects/xlw/
The version in question is 4.0.0alpha0


Best
Ninds

Offline Ninds

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: Building Excel .xll addins with Code::Blocks & MingW
« Reply #1 on: June 19, 2009, 07:20:28 am »

A clip showing how to create Excel XLL addins with Code::Blocks & MinGW

http://www.youtube.com/watch?v=UmkSLesszqQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Building Excel .xll addins with Code::Blocks & MingW
« Reply #2 on: June 19, 2009, 08:31:49 am »
A clip showing how to create Excel XLL addins with Code::Blocks & MinGW
Not bad. Looks good to me. Nice to know such "things" exist. I have been a VBA dev for years...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Ninds

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: Building Excel .xll addins with Code::Blocks & MingW
« Reply #3 on: June 19, 2009, 10:17:49 am »
Thanks, glad you liked it.
With XLW you can also build XLLs with VB.NET, but you need another unmentionable IDE ;-)

xlw4.0 has now been released as Beta. It can be downloaded at

http://sourceforge.net/project/showfiles.php?group_id=45222&package_id=37893&release_id=690866



Offline cacb

  • Lives here!
  • ****
  • Posts: 536
Re: Building Excel .xll addins with Code::Blocks & MingW
« Reply #4 on: June 21, 2009, 02:24:31 am »
Thanks, glad you liked it.
With XLW you can also build XLLs with VB.NET, but you need another unmentionable IDE ;-)

xlw4.0 has now been released as Beta. It can be downloaded at

http://sourceforge.net/project/showfiles.php?group_id=45222&package_id=37893&release_id=690866

Nice. Is it only for creating excel plugins, or can you also write C++ applications reading & writing to XLS files this way?

Offline Ninds

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: Building Excel .xll addins with Code::Blocks & MingW
« Reply #5 on: June 21, 2009, 09:13:18 am »
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 :
http://support.microsoft.com/kb/178474

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 ;-)

Best
Ninds



« Last Edit: June 21, 2009, 09:32:24 am by Ninds »

Offline cacb

  • Lives here!
  • ****
  • Posts: 536
Re: Building Excel .xll addins with Code::Blocks & MingW
« Reply #6 on: June 21, 2009, 10:42:28 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.
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!

Offline Ninds

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: Building Excel .xll addins with Code::Blocks & MingW
« Reply #7 on: June 21, 2009, 11:18:48 am »

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.

 

Offline Ninds

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: Building Excel .xll addins with Code::Blocks & MingW
« Reply #8 on: July 18, 2009, 12:44:24 am »
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.

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.









Offline Ninds

  • Multiple posting newcomer
  • *
  • Posts: 18
Changes in MinGW reflected in the new xlw (4.0.0b1) ready for download
« Reply #9 on: July 20, 2009, 09:43:18 pm »

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 (https://sourceforge.net/projects/xlw/files/) 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 :

                    http://www.tdragon.net/recentgcc/

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.

A'sD



Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
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)

Don't use the bin-directory, use the directory, that contains the bin directory (as mentioned on the toolchain-tab) :

Quote from: Toolchains executables tab in compiler options dialog
NOTE: All programs below, must exist either in the "bin" sub-directory of this path or in any of the "Additional paths"...

This should be (for the example above) C:\GNU\MinGW.


Offline Ninds

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: Building Excel .xll addins with Code::Blocks & MingW
« Reply #11 on: July 20, 2009, 10:10:11 pm »
Thanks for the heads up.

Offline Ninds

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: Building Excel .xll addins with Code::Blocks & MingW
« Reply #12 on: July 22, 2009, 06:54:57 am »
The latest Beta can be downloaded from http://xlw.sourceforge.net/

Offline Ninds

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: Building Excel .xll addins with Code::Blocks & MingW
« Reply #13 on: October 28, 2009, 06:06:01 pm »


XLW 4.0 has been released. It can be downloaded from http://xlw.sourceforge.net/.
Any feedback and suggestions for using XLW with Code::Blocks would be more than welcome at the xlw-users mailing list.

Offline Ninds

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: Building Excel .xll addins with Code::Blocks & MingW
« Reply #14 on: February 11, 2010, 09:55:49 am »
The take up of Code:Blocks for building XLL's with XLW has been very good. Traditionally Visual Studio has dominated this area. But we are getting more and more questions and feedback from people using Code::Blocks.

Some users have experienced minor issues in getting a working installation of Code::Blocks with XLW & MinGW.
The problem has occurred when Code::Blocks has been  installed with the default C++ compiler set to mingw32-gcc.exe and the default linker also set to mingw32-gcc.exe, i.e the C compiler and C linker when they should have been set to mingw32-g++.exe. User have then seen link errors complaining of undefined references to symbols that are part of the standard C++ library.

The problem can be replicated as follows :


1. write a simple "hello world" program, test.cpp that uses cout or
std::vector
2. Compile :- g++ -c test.cpp -o test.o
3. Link. :- gcc test.o -o test.exe

The above should give you the errors about undefined references to
symbols which you would expect to be in he standard C++ library

Now if you change step 3 to :
3. Link. :- g++ test.o -o test.exe

Then there should be no errors

I would assume that it is quite rare that Code::Blocks would incorrectly
set the C++ compiler and linker obviously here but it has happened.

Users of MinGW and Code::Blocks are advised to download and install in the order

(1) Download and install MinGW (v 4.4.0) with xlw MinGW Installer http://sourceforge.net/projects/xlw/files/xlw-mingw-installer/MinGW%20_%20GCC4.4.0/xlw-MinGW-Installer.exe/download


(2) Download and install the version of Code::Blocks WITHOUT the MinGW compiler at  http://www.codeblocks.org/downloads/5

(3) Download and install version 4.0.0. of XLW at  http://sourceforge.net/projects/xlw/files/xlw/xlw%204.0/xlw-4.0.0f0.exe/download

(4) Furthermore :
Check under C++ compiler that mingw32-g++.exe is there (and not mingw32-gcc.exe),
Check under Linker for dynamic libs. that mingw32-g++.exe is there (and not mingw32-gcc.exe).


A Youtube video demonstrating this process can found here :
http://www.youtube.com/watch?v=PvQPEWKPB1w