Transform Excel VBA in a Web-Service function - web-services

I am working on a project, that has Excel VBA code.
We need to execute the VBA code concurrently (Excel has not be modified between executions).
NOTE: The VBA code is called by another system.
Goal: transform Excel VBA code in a web-service function
The first idea was put the Excel on Sharepoint, but this is not a choice as we can see on: http://community.office365.com/en-us/w/officeapps/excel-workbooks-with-macros-do-not-open-in-excel-online/revision/2.aspx
Is Excel Calculation Services our solution? I never heard about that
https://technet.microsoft.com/es-es/library/cc263457%28v=office.12%29.aspx
Another option without Excel: discard the Excel and construct the Web-Service logic in an OOP language (like Java), the only trouble about that is the reverse engineering on a very complex Excel.

This really depends on your circumstances, its true that VBA won't work in a web view of an excel file on sharepoint, but if you open the file in excel the VBA macro should work fine.
If the macro needs to access network resources via sharepoint where you don't have webDAV access to the share then its more tricky but can be done.
Can you clarify your situation.

Related

Turning a DLL (and associated VBA) into an XLL

As a summer project, I got handed a large C++ file with numerous (over 50) functions and was asked to make it interface with Excel. I created a DLL from the C++ file and wrote some VBA procedures to create function wrappers, function wizards, and populate cell ranges with the correct data.
As I have to hand this off to someone else, I would like to turn this into an XLL add-in so the pathway to the DLL in the VBA "Declare Function" doesn't get broken, as well as having a cleaner setup.
My question is, what becomes of the VBA code in the process of turning this into an XLL add-in? Do those functions have to be re-written into the C++ file?
Chris
The XLL interface does not cover as much of the Excel object model as VBA, and is less productive for user interface tasks. But it has many advantages over VBA for building UDFs (performance, UDF registration, multithreading etc).
So my recommendation would be to convert all the UDFs to XLL but keep the function wizards and any other user interface stuff in a VBA XLAM.

Can I save delta information from a spreadsheet?

I am going to develop a generic C++/Qt GUI tool for data I/O from the user.
The data will be directed to/from the core application through a file.
However the same task could be performed by a spreadsheet. The only doubt I have is whether spreadsheets can save/load only the data that have changed since the last save/load operation, even in a temporary file.
I would like to know if this is a common feature among spreadsheets (especially the open source ones).
Do you mean with spreadsheet a software like Excel or or OpenOffice calc? That's a big difference to a customized Qt application. I am sure you can do this with Excel or OpenOffice calc. To decide the way to go it is more important which other requirements you have. Who should use the application and for which purpose? Do you know the neccessary programming languages/frameworks? Which functions should it implement?
Without a LOT more details you will not get a good answer here.
It seems that with spreadsheets (e.g. Excel, LibreOffice Calc, ...) it is not possible to save/load portions of the project, not even in a temporary delta file.
For these tasks, a database is the tool to use.

Node.JS/C++/Python - edit Excel .xlsx file

I'm looking for a way of editing and save a specified cell in Excel 2010 .xlsx file from Node.JS. I realize, that maybe there are no production-ready solutions for NodeJS at this time. However, NodeJS supports C++ libraries, so could you suggest me any suitable lib compatible with Node?
Also, I had an idea to process this task via Python (xlrd, xlwt) and call it with NodeJS. What do you think of this? Are there any more efficient methods to edit XLSX from NodeJS? Thanks.
Basically you have 2 possibilities:
node.js does not support C++ libraries but it is possible to write bindings for node.js that interact with a C/C++ library. So you need to get your feet wet on writing a C++ addon for the V8 (the JavaScript engine behind node.js)
find a command line program which does what you want to do. (It does not need to be Python.) You could call this from your JavaScript code by using a child-process.
First option is more work, but would be result in faster executing time (when done right). Second possibility is easier to realise.
P.S.: To many question for one question. I've no idea about the xls-whatever stuff, besides it's "actually" only XML.

Making charts in excel programmatically

I have an XLL made with the help of the XLW wrapper for Excel's C API. I would like to be able to programmatic make charts in excel using data stored in some objects in the XLL. Is this possible and if so, what is the best way to do it? I believe one way to do is through COM but would like to avoid it if at all possible.
Currently using Excel 2007 on Windows 7 and VS2010.
Edit: In general what API does excel expose that supports programmatic charting? Can anyone point me towards some documentation?
Edit2: Since I'm not getting any hits I will try to give a little more detail abaout what I'm trying to do. I want to call a formula from Excel like =PlotCurve("CurvreHandle") and I want to get a curve object stored in memory and owned by the XLL (unmanaged code), get an some data from it and display it in a chart somewhere on the sheet where the PlotCurve was made. From what I have been able to gleam so far, the C API that XLW is wrapping offers no support for the second part of the problem so I need to go to either COM (which I have no idea how to mix with the already running C api) or some .net interop which I also don't know how to do . If someone has ever done something like this or knows of a safe and stable way to do this, I would love to hear it.
You can use http://xll.codeplex.com and Excel4/Excel12. The function ExcelX can be used to handle the memory management. The command to use is xlcChartWizard.
To create, modify, save charts in Excel programmatically you can use the C++ classes in the Microsoft.Office.Interop.Excel namespace.

best way to programmatically modify excel spreadsheets

I'm looking for a library that will allow me to programatically modify Excel files to add data to certain cells. My current idea is to use named ranges to determine where to insert the new data (essentially a range of 1x1), then update the named ranges to point at the data. The existing application this is going to integrate with is written entirely in C++, so I'm ideally looking for a C++ solution (hence why this thread is of limited usefulness). If all else fails, I'll go with a .NET solution if there is some way of linking it against our C++ app.
An ideal solution would be open source, but none of the ones I've seen so far (MyXls and XLSSTREAM) seem up to the challenge. I like the looks of Aspose.Cells, but it's for .NET or Java, not C++ (and costs money). I need to support all Excel formats from 97 through the present, including the XLSX and XLSB formats. Ideally, it would also support formats such as OpenOffice, and (for output) PDF and HTML.
Some use-cases I need to support:
reading and modifying any cell in the spreadsheet, including formulas
creating, reading, modifying named ranges (the ranges themselves, not just the cells)
copying formatting from a cell to a bunch of others (including conditional formatting) -- we'll use one cell as a template for all the others we fill in with data.
Any help you can give me finding an appropriate library would be great. I'd also like to hear some testimonials about the various suggestions (including the ones in my post) so I can make more informed decisions -- what's easy to use, bug-free, cheap, etc?
The safest suggestion is to just use OLE. It uses the COM, which does not require .NET at all.
http://en.wikipedia.org/wiki/OLE_Automation <--about halfway down is a C++ example.
You may have to wrap a few functionalities into functions for usability, but it's really not ugly to work with.
EDIT: Just be aware that you need a copy of Excel for it to work. Also, there's some first-party .h files that you can find specific to excel. (it's all explained in the Wikipedia article)
I don't know if this is an option for you, but the new office 2007 formats are in zipped XML format, which makes it very doable to do your own modifications. See here for the specifications.
SpreadsheetGear for .NET will handle your requirements and has an API which is very similar to Excel.
When you insert cells, your defined names (and any other formulas / charts / etc...) will automatically be fixed up to reference the new range (just as they would in Excel). So you would not need to update your defined names (although there is complete support for creating and updating defined names if that is what you want to do).
SpreadsheetGear is a .NET component, but you can build your own wrapper which is callable from C++.
You can see what our customers say and download the free, fully functional evalution here.
Have you already tried using the Excel COM interfaces? Obviously Excel needs to be install on the machine, and it's a pain to deal with...
I would argue that a .net solution with COM interop for linking into your C++ application is the best solution. In more than ten years of working with them, I've never seen a COM automation of Excel that didn't leak memory somewhere.
If you need to automate Excel, I recommend Visual Studio Tools for Office. If you don't need to automate, only modify files and those files can be in Office 2007 format, you're better off finding a library that manipulates the files directly instead of opening Excel to do it.
I ended up using Aspose.Cells as I mentioned in my original post, since it seemed like the easiest path. I'm very happy with the way it turned out, and their support is very good. I had to create a wrapper around it in C# that exported a COM interface to my C++ application.