Archive for the ‘Excel’ Category

Software developers are patronising

Friday, 4th April, 2008

I just switched on my pc and went and brewed up. It turned itself off - thanks.

I read some software developer guidelines years ago that the default action of any dialog should be to leave the computer as is. Great! that saves idiots from accidentally destroying their computer. But it also means the default action is to ignore the users request. That seems pretty dumb/arrogant to me.

The Apple approach (as I understand it) is to let the user do whatever they want, but make it easy to undo. That seems to make more sense than to make it hard for them ‘for their own good’.

I did try turning off the ‘are you sure you want to delete that file’ warning, as I know I can get it back from the re-cycle bin, but I like the comfort of clicking Yes (without thinking) to the warning so I put it back.

I find that I turn off many of the Excel warnings, as they are covered by undo anyway. Things like ‘are you sure you want to overwrite those cells’ when pasting is turned off (along with all similar warnings) as I know I can either undo or revert to a saved version if things go badly wrong.

Do you agree that some of this stuff is patronising?

Do you turn off the warnings (Excel and elsewhere)?

What do you do with the systems you build for others?

cheers

Simon

Getting a range

Wednesday, 26th March, 2008

How do you get a range in code?

If its a marker range (a single cell where I start my code from) I tend to name it at worksheet level then access it via

sheet1.[StartPoint].row/.column/.value etc

If I am looping through cells I use

.cells(r,c).value/.formula etc

I almost never use range(”A” & r) as it has a (part) fixed text cell reference that often ends in tears if someone modifies the sheet.

Bob P was outraged that I used [StartPoint] instead of Range(”StartPoint”), he now thinks I am a total cowboy. What do you think? if you don’t like [], why not? I was going to test the performance but its completely irrelevant as I only access these once.

I wish worksheet level defined names popped up in intellisense as a worksheet property, like public code thats added to a sheet class. This [] approach seems like a reasonable compromise to me. Obviously I’m not going to be wasting time wrapping a cell ref in a property (or variable) just to make intellisense do what I want. (Or should I?)

Whats your preference?

cheers

Simon

Browser wars

Monday, 17th March, 2008

Did the browser wars kill VB?

I’m only asking as years ago (say 1999) it was fine to build intranets using VB script on the client, because you could assume they would be using IE.

I don’t hear so much of that now, it used to be ‘VB everywhere’, now it seems to be Javascript most places and C# where possible.

I’m wondering if the reduction in love for the VB family coincided with IE haemorrhaging market share to Firefox? (Ff marketshare is almost 30% in Europe, and gaining, fast).

Maybe VB fell out of favour a bit before?

Or maybe you don’t think it has?

Get patching

Wednesday, 12th March, 2008

Microsoft have released some security patches to address critical flaws in Excel and some other Office components. Details here, looks like 2003 SP3 and 2007 SP1 are pretty much ok, but worth patching to keep everything in sync.

El Reg has some info here too.

The key point I wanted to make which people seem to miss is that this exploit (like many others) does not require macros. So clicking ‘disable macros’ doesn’t keep you safe. It is simply a malformed file, that may not contain macros or any data at all, just a certain binary sequence.

Another point worth mentioning is that in this attack like many others the attacker gets the same rights as the user they hacked. This is why so many security pros recommend running as the most limited rights user you can. Unfortunately to get any development done its much less hassle to run as admin, sadly that means an attacker would get admin right too.

If you apply the patches and have any problems let us know.

cheers

simon

Eusprig topic suggestions

Tuesday, 11th March, 2008

I wasn’t planning on submitting a paper for consideration at this years Eusprig. But now I’m thinking I should. The deadline is looming however and I havent really got an obvious topic, thats where you come in…

The conf title is ‘in pursuit of spreadsheet excellence’ and papers need to relate to that somehow.

Last year we did spreadsheet hell, covering some of the cultural issues around corporate spreadsheet use.

The year before I did the process I use for reviewing client spreadsheets

The year before that I did some of the strengths and weakness of spreadsheets compared to other technologies.

[one possible one is User defined functions in XLM or something similar around function definitions]

So my question is, is there a topic you think I should cover, or that we should cover as a group?

Many of the Eusprig prior papers have been archived on-line here.

Please leave any suggested topic areas as comments, thx

(anything that incorporates my new logo suggestion is especially welcome!)

cheers

Simon

more ribbon fun

Monday, 10th March, 2008

Got an ‘anonymous’ tip off about this excellent article here.

The author is a well known and respected quant who has contributed some excellent xll stuff to the community. He comes to a similar view on the ribbon as many of us, but raises some interesting points along the way.

The most interesting one, and one that hadn’t fully occurred to me is the impact of alienating power users. I had wondered if power users had the power to sway purchase decisions, and the general view seemed to be that the people in power in most orgs were probably not spreadsheet gurus (but they might listen to them). So direct influence = no, indirect = maybe.

I had missed the ‘role model’ aspect. He uses the example of Photoshop with pro photographers. Adobe clearly gain some non pro sales from folks wanting to emulate the experts, and the fact that most magazine articles demo Photoshop helps too.

I’m not sure the spreadsheet market is quite so competitive, but it is becoming more so. What I mean here is that Windows machines come with a basic graphic editor (Paint), but no basic spreadsheet. But Open Office and the Google offerings are starting to gain momentum…

As a power user (’role model’?) I’d prefer to invest in learning the products that respect that investment. This has to be balanced with progress/improvements of course. Microsoft seem to be aiming somewhere different to me in this regard but then rapid obsolescence is the basis of their business model I guess. I don’t think that is conducive to a vibrant expert community, or expert consulting business models though.

A boost in on-line resources targeting OOo Calc could quickly undermine the Excel ecosystem I reckon. And the power users/role models, those that the interface shuffle hurts the most, are the providers of much of that ecosystem.

BTW my main ribbon objection is shuffling the commands, (and what that represents in the big picture) all the other stuff I would live with. It is after all just a fat clumsy toolbar.

And those of us who were on the beta program will no doubt recall the impact of the ribbon and the response it got, although I guess thats all covered by NDA?

I remain to be convinced that Office 2007 is booming sales-wise, if it were, there would be proper hard facts to back it up. If anyone has links please leave as comments, ta.

cya

Simon

Hey Scripting Guy - RTFM

Sunday, 9th March, 2008

In perfect timing with my last post Ken Puls sent me a great link.

This is a superb illustration of a couple of points:

  1. Invest in learning or stick with what you know?
  2. Non Excel developers seriously under-estimate the power of the market-leading spreadsheet.
  3. Excel skills are ignored everywhere.

For someone with SGs background (scripting guy, Excel ignoramus) the approach probably makes the most sense. There are potentially better approaches depending on a bunch of stuff. Conditional formatting jumps out as a candidate if it is to be dynamic.

So RTFM is maybe a bit harsh in this particular case I think, but it is a shame to see MS folks treating Excel like some dumb grid when it is so powerful.

I guess thereĀ  are plenty of things I do badly rather than learn how to do it right. And there are plenty of things I actively avoid getting into at all (Java for example).

What do you think? Too harsh, too severe?

cheers

Simon

VBAIDE refresh in Office14

Tuesday, 4th March, 2008

If ‘VBA is forever’ and MS are ‘fully committed to it for the foreseeable future’.

And bearing in the mind the IDE has not been touched in 10 years (10 years FFS - what were you doing 10 years ago?). (I am not counting getting the mousewheel to work in 2007 - sorry)

What improvements can we expect in Office 14? Or more realistically, what improvements would you like to see?

Here is mine:

  1. Please please please - no dumbassed ribbon
  2. Please - no breaking VBA ‘improvements’ (parameterised constructors would be ok)
  3. Please - no unrealistic deployment requirements.
  4. code snippets
  5. Procedures in the project explorer
  6. Tabbed editor
  7. Perhaps a VSTA style editor, but writing proper VBA.
  8. window docking that is controllable

Of course it will continue to be challenging for us devs to believe MS has any commitment to VBA if the IDE is left to stagnate.

What would you like to see?

Do you think there will be any useful changes whatsoever?

cheers

Simon

Why VBA is so rubbish

Tuesday, 4th March, 2008

The last VBA post may have given the impression I’m some kind of VBA fanboi. I think it has its place, but it’s far from perfect. I put my definition in that post so I wont repeat it here.

I think its important to keep in context of what is out there live in the real world now, so I’m not going to suggest another language is better. In pure terms python (or your personal favourite language) maybe a better language for users to do basic automation etc. The reality is there is a lot of VBA code around, and more gets written everyday. I think the language would benefit from a few modern features, perhaps to support OO more fully, but not at the cost of backwards compatibility.

I’m also going to skirt around the issue of user competence. You get crappy code in every language, some languages may encourage it more, or may be more attractive, or more accessible, to developers of limited skill and experience.

It has been suggested that giving something as powerful as Excel/VBA to an unskilled user is the equivalent of giving a loaded rifle to a child. The reality, I would suggest, is a little less dramatic, as far as I know, no one has ever been killed by a poor quality spreadsheet, and very few companies have gone bust because of one. Yes SocGen just lost a stack of cash, but a person did that by trading badly, not a spreadsheet.

VBAs biggest fault?

I’d say its too easy to go beyond its design envelope.

For simple automating Excel and standalone complex worksheet functions (eg: the stuff Mike talks about) I think it is great. Its easy to slip from there to 10/12/14 KLOC systems, at which point I think VBA can work against you.

The other side to that argument is perhaps there is no realistic migration path, or no realistic alternative. That may or may not be true, but either way is not a fault of VBA.

Second - The editor. Frankly its so arcane I think Integrated Development Environment is a bit rich. If this just got updated to the VB6 one (which has more visible object model) add-in devs would fix everything else. Ideally though I’d like a VSTA style editor that writes proper VBA, or something completely compatible, in Excel 14.

That would also fix my third biggest fault - Microsofts lack of public love for VBA. Many devs are worried about its future, and hollow verbal assurances don’t cut it. A significant investment in upgrading the IDE, or replacing it with the VSTA one would settle the uncertainties for many.

Speeding up the call interface would be excellent too. As would allowing VBA UDFs to participate in multi-threaded calculation.

VBA’s reputation as a meddlers monster creation system (/toy language) hardly makes it the sort of thing you want to own up to at a party. The political correctness bureau solution to that is the change the name (eg ‘disabled’ went to ‘people with disabilities’ now moving to ‘differently abled people’) in general the ‘name’ gets longer as they use more circuitous language. So perhaps renaming VBA to something like AAS (Application Automation System) would fix any stigma? (of course it would have to be MAAS or MOCAAS (Microsoft Office Client AAS)). You get the idea.

Any other suggestions? the ruder the better.

What would be your top 2 or 3 weaknesses of VBA?

cheers

Simon

Ribbon positions

Monday, 3rd March, 2008

In all the ribbon discussions I have seen there seems to be 3 possible positions.

  1. Overall it was a bad move - the cons out weigh the pros
  2. Overall its was good, adds useful functionality without taking away anything important
  3. The ‘it happened get over it’ crowd.

Obviously I am in the first group, but I completely respect those that hold the second view. I think this comes down to personal priorities. Its a fact of development that there is a broad range of customers with a broad range of requirements. Its no surprise what works for one won’t for another.

The third group though, state the obvious and add nothing to the debate. Its not a problem to not care about a discussion, there are plenty of debates going on that I don’t care about. I just don’t bother joining in where I’m not bothered.

This third group seem to have limited options themselves and are perhaps unaware of options that are available. For example I am considering the option of moving more into Excel to OpenOffice Calc conversions because I think the ribbon is boosting that market. Others have moved into the ribbon replacement UI business for example. I’m also thinking about some more web-centric stuff too.

I do think its worth discussing the ribbon and the breaking UI changes MS are introducing throughout their products. Microsoft are listening and given enough encouragement could (possibly, maybe) be persuaded to change course.

Those who are less familiar with Microsoft may see it as a single entity with a single point of view. In fact like many organisations Microsoft is made up of people, and those people often have different points of view. There are people within the Office team that think a compatibility mode would have been a good thing. Just as there are people who are convinced the ribbon is the ‘one true way’.

They are currently part way through developing Office 14, if the community kick off enough, and if the ribbon can be blamed for weak sales, who knows what delights might await us in O14? I’m not holding my breath of course, neither am I sitting back.

I don’t think MS could back down and re-introduce commandbars. But they could open the object model back up for us devs to put them back. (In a no loss of face stylee).

Of course the fact that there is already a booming market in ribbon replacement UIs for Office should be cause for some rational thinking at MSO HQ.

cheers

Simon