MS

64 bit VBA

In my last post, VBA Version 7  Daniel, author of Daniel’s XL Toolbox, commented that he had not come across anything untoward with the “new!” version of VBA, and reported, so far, all is well with his addin – good news! Then JP from Code For Excel & Outlook, pointed to a  VBA Compatibility tool (tool, info) from MS – thanks JP, I think this is called team work! ;-)

Anyway, I believe the major update might be support of 64 bit types in VBA?  I’m not running a 64 bit OS to test, but I found this:

Excel 2010 can load much larger workbooks. Excel 2010 made updates to use 64-bit memory addressing in order to move beyond the 2-GB addressable memory boundary that limits 32-bit applications.

The down side of this is:

Visual Basic for Applications (VBA)   VBA code that uses the Declare statement to access the Windows application programming interface (API) or other DLL entry points will see differences between 32-bit and 64-bit versions. The Declare statement must be updated with the PtrSafe attribute after inputs and outputs to the API have been reviewed and updated. Declare statements will not work in 64-bit VBA without the PtrSafe attribute. New data types are added to 64-bit Office 2010 VBA: LongLong and LongPtr. For more information about VBA, see the “64-bit VBA Overview” and “Declare Statement” articles in the Microsoft Visual Basic for Applications online Help in Office applications.

So if your using API calls in you VBA, and you hit a 64 bit versions, you could be about to hit some issue. Doesn’t sound like the fix will be to hard though, but we’ll wait and see eh!

Bonus thought: Does this mean the C API has been updated too?

VBA version 7?

Any one else noticed this?

VBAversion7

Thats a Major revision number, that should mean there’s been some significant updates should it not? Anyone seen any, I’ve haven’t!

iWrite Pro, ribbon fail?

The second thing that caught my eye in this weeks micro mart was a review of word processors. There where a few I’ve not seen before, which was interesting in itself. One I found really interesting, for two reasons was iWrite Pro. The first is the description of the UI:

It’s all very reminiscent of word 2007, but is that a good idea? Word is confusing for people not used to it because it is hard to find the function you want and some people prefer the old style of menus used in previous versions. Iwrite Pro’s ribbon is a different kettle of fish though and it’s not nearly as irritating. This is because it is a simpler program with fewer functions and it’s easier to find the one you need on the tabs.

here’s a picture:
iWritePross1.jpg

Well, what can you say? Fail?

But perhaps the more surprising aspect is that iWrite Pro can actually implement the ribbon UI, – OK perhaps the most surprising thing is that anyone would want to, but regardless doesn’t this contravene the ridiculous ribbon Licensing agreement, and if they’ve rolled there own (which it looks like) and not signed with MS, then how long before MS come knocking?

Microsoft, you just get office developers don’t you?

hummm, insulting, fun, totally missing the point, a bit of all three?
VBA Person

Dot Disaster, Frameworks don’t work!

The world of managed com addins is a mess. VSTO has not been received well and the story of unmanaged code (Excel) and managed code is of deployment and stability nightmares.

There are a quite a few things right from the off that cause problems for Office devs wanting to use .Net technology:
- .Net is inherently slow, and slower still when com interop is needed
- mscorelib (hell, ;-))
- Security
- Deployment (esp. VSTO < v3)
- Framework availability

VSTO and managed com addin can over come the first 3 issues by using so called “com shims”, which are proxies sitting between the managed code and the com application (com shims themselves are unmanaged code). Although these solutions actually compound some of the other problems (i.e. speed), they generally work well and have been successful.

Deployment for managed com addins is not such an issue, as it is up to the dev to ensure the addin installs correctly. However the first two versions of VSTO tried to simplify this process, unfortunately Microsoft never “managed” to get it right. VSTO 3 seems to have cracked this particular nut, although we should wait for reports from the wild until we take this as gospel.

ms1.PNG

There is little anyone can do about framework penetration, but having to install a .Net framework to run a addin if frankly a laughable proposition and there is quite literally no way to avoid it, it’s fundamental to the concept of .Net. The problem then becomes what if users are unable to install frameworks. The thinking is that this problem will vanish with time, as windows service packs and new installs load the framework “organically”.

However, the last point may be moot because there is potentially a black cloud hang over managed code and Office!

Stephane Rodriguez of xlsgen points out that the framework version Excel (office) loads first, will be the framework versions that all subserquent managed addins will have to use. The com shim does not effect this out come as it’s controlled at the Application level, i.e. the process belones to Excel, not to your addin. This is comfirmed by Microsoft here, where the conserquencies are spelt out quite plainly!

If other managed code, such as an add-in, requires the later version of the .NET Framework, it will not run.

In the research I have briefly done of this issue there does not seem to be a solution available as of today. This seems like quite a serious shortcoming, and to me at least, hugely surprising because one would imagine that MS are aware of the implications.
It does beggar the question as to why this sort of thing should ever be an issue for devs, Microsoft trumpet long and hard about how easy MS products are to use, and often that is true, but with .Net and Com this could not be further from the truth.

This the is yet another blow for .Net and Office, it has implications for all the .Net technology, VS, VSTO, and VSTA (should VSTA ever make it in to a actually product?!), what are MS doing to us?!!?

I’m a big fan of .Net, its quick and easy, and very powerful, but is it the right tool for current office products? It’s Unlikely that MS will port Office to a .Net platform (currently no MS product of note are built using .Net odd that!)

So where does that leave us? VB6 has long departed (although is still exceedingly popular) VBA is no longer developed, MS variations of C, and their claims to nativity is up for debate and it’s hardly a tool you want to use to build true RAD solutions. So, anyone for Delphi?