Thursday, June 30, 2005

How to recover source code from your old VBA projects

Yes, I have been on blog vacations, or hiatus for the Nth time. I have much going on in my life, but I just don't feel like writing lately. Not every day.

Anyway, I have just found by myself a solution for a long standing problem, and I wanted to share in on the web, just in case somebody else needs it. The fact is that I have googled a lot for a solution for this, and I have found the same question formulated several times, but never an useful answer.

Now, straight to the story...

Some years ago, using Office 2000 Developer (or was it Office XP Developer?) I created a little Outlook addIn that helped me remove duplicate mail items with ease.

If you are wondering why did I need that, there are several possible reasons. Think about POP3 server request that timeout too fast and download the same emails on each retry. It happens to me all the time with large attachments in my GMail account. Another reason would be odd rules in Outlook that creat create duplicate emails.

On the days of Office 2000 and XP Microsoft used to provide the option to create addIns straight from within VBA. Those projects were saved as .VBA files and you could also compile them to DLLs. That functionality used to come with the Developer Edition of Office.

Later, when Office 2003 came out, this functionality was cut. I mean, Office 2003 Developer Edition does not exist at all. What exist is Access 2003 Developer Extensions, which covers most, but not all the Access related functionality found in previous Developer Editions, and Visual Studio Tools for Office, which is a brand new creature.

Among the most important features that Microsoft left orphaned on Office 2003 I can mention:
  • Access - Source Safe Integration (which was fortunatelly addressed more recently via a free download)
  • The ability to create compilable, self contained VBA Projects and Office addIns.
I am not really interested in continuing the development of my "remove duplicates" addIn as a VBA project, as this is clearly obsolete technology. But I recently found a few bugs on it, and I wanted to get access to the original source code in order to migrate it to VSTO. But, I haven't been able to see the source code since support for VBA projects was discontinued.

Mine is a really simple addIn, but I am too lazy to write it again. So, being laziness the mother of invention (or, er... hacking), this is what I found today:

Off all Microsoft Office 2003 applications, there is at least one that allows you to create macros in VBA but don't have an application specific file format: FrontPage. Instead of defining a proprietary file format, FrontPage allows you to edit standard HTML and related files, so I guessed FrontPage had to save VBA macros somewhere else. Yes, you guessed it! It saves its macros in a file called "Microsoft FrontPage.fpm" in %USERPROFILE%\Application Data\Microsoft\FrontPage\Macros.

Update: A few minutes after posting this, I found that I could have used Outlook's own VbaProject.OTM, with the advantage that the code could possibly run.

A simple binary comparison revealed that both the .FPM file and my old .VBA shared the same header format. Hmmm.... So the .FPM file uses the same conspicuous self contained format that .VBA projects used!

The obvious solution was to temporarily rename the .FPM and to copy my VBA project to the same folder with name "Microsoft FrontPage.fpm". Next you open FrontPage, you go to the Tools menu, Macro, Visual Basic Editor, voilaá, your VBA code is back.

I copied it to a text file, closed FrontPage and restored the files to their original names and locations. Enough for today. Lazinesss rules!

Disclaimer: if you want to reproduce the steps described above, and you make a mistake, you are on your own.

PS: Isn't it amazing how many problems you can solve by temporarily renaming files? I have found quite a few otherwise unsolvable problems with SQL Server and Outlook that I could solve this way. Well, they are otherwise unsolvable because I don't have access to source code!

PS2: I plan to publish the lame code for this addIn in a future post. Maybe when I am able to port it to VSTO I will publish both sources and a detailed comparison.

Friday, June 10, 2005

Microsoft giving some goods for free, based on customer feedback

A few days ago, I learned trough Tim Heuer's blog that Microsoft has decided to include a Team System Server for 5 users with each copy of Visual Studio Team System. That is great. A testimony to how much a company can improve customer relationships just by listening (mostly listening to what is said in the blogsphere).

Also, today I learned that Reporting Services is going to be included in every version of SQL Server 2005, even in the Express edition (without the report builder). Oh dude! That is great news, and the good thing to do. A reporting runtime that will be everywhere and will be used by everybody was born.

My entry on the "Blog your way to the PDC" contest

So, now I have to explain why I would like to go to the PDC?

First, the same reasons the others want to go: It is the best place to learn about the present and future of software development for the Microsoft platforms (although, a Geek Cruise would be good enough ;)).

Second, the place is going to be filled with bloggers I read every day. Some of them are like rock stars to me. I want to meet them in person for once. By the way, is the Don Box Band playing this year?

I have never been in such a major event, but in local dev days in Argentina and in conferences in the Dominican Republic.

If I win, however, I would like to buy a Tablet PC and blog the PDC in real-time, but in Spanish (yes, my Spanish is WAY BETTER than my English). That would be, I think, a nice way to share the gift with the community.

I can think of other ways. What about writing some code with the new tools and publishing some articles in both Spanish and English? Well, were you going to ask me for proof that I can actually do that, you would put me in trouble because I am not doing it at present. But I know I could do fine.


blogging my way to pdc


Ok, I know I am not going to win this contest... But, what the hell? Choose me!!!

Monday, June 06, 2005

Microsoft to be third Transitive customer?

I woke up to late to the Internet today, and everybody is talking about Apple's inminent switch to Intel hardware. I read a few articles about it, and the rumor is that the main reason is the DRM hardware support included in upcomming Pentium D processors. Fascinating. I wonder how is this related to Paladium. They also mention future video iPods, which Apple has hinted int the past were a terrible idea. So, were Apple playing pocker then or is industry journalism too dizzy today? Only time will tell.

Reports also mention Apple will be liscencing Transitive hardware virtualization technology to ease the transtition of Mac OSX applications to the new processor. This company is said to claim that it can run anything on any platform without performance penalties (uh?). Fascinating also.

Even if I my last crystal ball prediction (that Google would buy Skype within a month, more than a month ago) was incorrect or perhaps too much ahead of time, I will risk again. Transitive says in its site that they have "engaged with six of the world’s largest computer companies", but they can only tell about one, SGI. The also add:

Transitive expects to announce that a second computer OEM will deploy products enabled by its technology during the 1st half of 2005 and that others will deploy QuickTransit before the end of the year. Unfortunately, strict confidentiality obligations prevent us from discussing these relationships in any detail.


So, if the the second would be Apple (to be probably officialy announced today), my guess is that the third and four would be Microsoft and Sony, that would use Transit for XBOX 360 and PlayStation 3 respectively. Let's wait an see what happens.

Sunday, May 22, 2005

Rory doesn't like Episode III

Gorge Lucas directing, according to Rory:

George: OK - cut!
Actor: Cut? I was just practicing for when we actually do the scene. I didn’t know we were filming yet.
George: Good enough!
Actor: But I was reading from the script! It was in my hands the whole time!
George: Fine. We’ll Photoshop it out later. We’ll stick an ewok in there or something.
Actor: You can’t do that! It’s going to look like I have my hand up the ewok’s ass.
George: Good point. We’ll make it look surprised.

Hehehe! Well said, but I still like it.

I never understand how two people can disagree so much about a movie when they think alike in other matters. I guess the thing is I watched the movie with a more "naive" attitude, on purpose. I do not have the same mindset when I see something from David Lynch or even Martin Scorsese. So yes, I would never put any episode from Star Wars in my Top 10 movies of all time, yet I feel free to enjoy most of them.

Well, at least I see that Dare Obasanjo and Chris Sells think more like me.

Star Wars Episode III

After reading all the critics I was sure I was to hate this movie. But I was wrong.

For instance I read from the critics that the dialogs were unspeakable. The movie is an epic story, a tragedy, about ancient alien civilizations. So, what do you expect to hear, accent and manners from Missouri, Shakespeare? Dialogs are ok.

They say that scenes in which Padmé and Anakin are alone together are impossible to believe. In my opinion this is not true. I think they show what the movie demands, which is a woman loving a deeply troubled guy. Natalie Portman makes the most of her role, which is just the right size. Ewan McGregor does such a great Obi-Wan, Alec Guinness himself would love it. Hayden Christensen is not bad as Anakin, I don't know what the problem is supposed to be. That he looks weak of temper, uncarismatic, sometimes pathetic? I think that is exactly the idea.

Not to insult the actors, but do you really remember how the first movie was? I mean, Episode IV? It was a joke compared to this movie, the acting (besides Harrison Ford and Alec Guinness), the effects (I actually don't care much about FX)... In general, the execution was amateur compared to this movie.

I am not too fond of the science fiction genre, but I think Star Wars is ok because it is an epic story at the same time. My favorites are Episode II, III and V and I wish Geroge Lucas had the time and the wish to make Episode I and VI again, but without the darn critters.

I am looking forward to "Episode III and a half" wich I am almost sure Lucas has in mind. More on Obi-Wan and Han Solo story maybe?

Well, I saw the movie today. Let's wait until tomorrow to see what happens.

Tuesday, May 17, 2005

Windows 'Eiger' to support legacy hardware

I found many interesting news today at ActiveWin. The one that blows my mind was about codename Eiger, a new 'lean' Windows XP version that is in the works.

This is exactly the answer to my previous post in which I explained why I felt Microsoft needed to pay more attention to legacy hardware.

Here is an excerpt from the Microsoft-Watch article:


"We have a set of customers running old PCs and old operating systems even as old as Windows 95," said Barry Goffe, a Windows group product manager. "These customers are primarily concerned about security, though some also are concerned about improving the manageability and TCO (total cost of ownership) of these systems."

Eiger will bring these users up to par with the level of security provided by XP Service Pack 2, Goffe said. It won't include the XP help and support content, wireless networking support and certain operating services found in XP, however.

Eiger will run on legacy systems with as little as 64MB of RAM, a Pentium-class processor and 500 MB hard drive. Eiger is designed to replace Windows 95, Windows 98 and NT 4 Workstation running on these systems.

Sounds great so far. But then it says:

"Eiger is not a general-purpose operating system. It can't run games, office-productivity software or line-of-business applications," he said. "We'll tell users that these kinds of things won't run well in this environment."

Hmmm... Hey, guess what you are missing? Either Microsoft also builds a 'lean' version of Office, or those users will run someone else software on 'Eiger'.

Saturday, May 07, 2005

Please include MFC and ATL with Visual C++ Express and Visual C++ Toolkit

I left this comment on AprilR's blog a few days ago:

I am a pro developer, but I don't use C++ as often as I wish during the day. So, I recently found that I could play with the language by getting involved in some open source projects. I found an interesting group that produces a free program for Windows.

While getting acquainted with this area of the “ecosystem”, I learned how much the community appreciates your recent release of the C++ Toolkit and the upcoming Express version.

Free or inexpensive software is necessarily built with free or inexpensive tools. In this case, using a commercial compiler had been limiting the reach of the project among developers. However, there is a big challenge: Big chunks of Visual C++ the product relies on, namely MFC and ATL, are absent from the “free” versions.

I can see why Microsoft would consider those libraries only belong to the professional version of Visual C++. But reality is that if MFC and ATL are not available, some existing projects like the one I have mentioned have few chances but to look somewhere else for alternatives. New free software projects have scarce motivation to target Microsoft tools and platforms.

I have also seen a huge number of compiling errors while porting from the Visual C++ 2003 to Visual C++ 2005 Beta 2. It seems that better ISO conformance, while a great feature, makes lots of errors surface. Perhaps you could add better aid tools for this task, even if it out of cycle. Thanks. Diego.

More on Visual Studio Team pricing estimates

A few days ago I saw the video in wich Rick Laplante explains the issues on Channel9. I have been thinking in the background about it, so I want to give some shameless feedback.

I think you are wrong when you say that nobody will really pay for the full price, that that is retail, etc. This is exactly what prices are for, or setting how much people have to pay for the goods. Simple is beautiful. So, please, keep it simple.

Also, as far as I understand, the problem with the prices is that they do not scale. A small independent consulting company with one to two developers should be able to get the product for a lot less. On the other side, a company with 1000 developers that will use the whole capacity of the Team Server should probably pay more.

Also, unit testing and some other selected features should be on all packages.

That's all.

Wednesday, May 04, 2005

My wild prediction: Google will announce it buys Skype in less than a month

Directly from my crystal ball. This one is very easy. Unless there is a big impediment, Google will (or should) buy Skype. It has bought other cool companies in the past, like Picasa and Blogger. Besides, they need a good messenger to complete the model an compete with Microsoft and Yahoo.

Also, I think SkypeIn will be really big, do you agree?

Tuesday, May 03, 2005

64-bit computing and legacy hardware support: The two sides of the Windows fence

Here is Scoble calling for nominations for Team 99, some kind of "external evangelists" group that will provide Microsoft with feedback on Longhorn and will also help with "communicating the good news" about the OS.

I posted there a link to my blog, in case somebody will want to nominate me. However, I am not expecting this to happen, as I am not very well known. I don't care. I usually give my feedback just because poorly worked software pieces (not only from Microsoft) annoy me a lot.

There are a few things interesting in the discussion following Scoble's post:

Andre Da Costa says:


Ok, if any of you get to become a part of this Team, try and deal with some of issues facing Windows today. Try and think beyond the average user base, think about Windows world wide. I am from a third world country where its still difficult to buy a PC because of cost. Try to think about how Windows can better conform to the needs of these economies or how Microsoft can better meet the needs of users in these countries through programs such as Starter Edition.

Good! Very good! I have spent a lot of time to thinking about this, and I agree completely. Microsoft needs to pay more attention to this.

Scoble replies (to me):

Diego: yup, and on the other side of the fence, Paul Mooney just reminded me not to forget 64-bit enthusiasts too.

Well, that is very important too. On one hand, if MS doesn't get 64-bit computing right with Longhorn, it will certainly loose some market to Linux and others.

But if they don't get legacy hardware support better than in the past... Well I wouldn't want anybody at Microsoft to get the idea that those millions of old government computers around the world will stick to Windows 98 and 2000. It is more likely that they will switch to Linux instead. And with them will go many developers all around the world.

It has been typical of Microsoft to push the hardware envelope on each new version of Window and this way they have increased their revenue and helped the hardware industry at the same time. Historically, most Windows copies have been sold on brand new computers, but year over year, the size of the installed base has grown.

This time, maybe the balance has shifted enough. Maybe it is time what is good for Microsoft is not exactly what is good for hardware makers. I mean, people would be happier paying for software, hadn't they have to pay for hardware upgrades so often.

What I would like to see is a very secure, manageable and stable version of Windows that is light enough to run on the same hardware that used to be the Windows 2000 baseline. It doesn't really matter if it is not very beautiful. It is enough that it runs Office, Internet Explorer and Terminal Server Client well.

I am cool with Microsoft adding 10 million lines of code to Windows on every new version, if they let people disable or avoid installing the heavier parts of it. For instance, I agree Avalon makes a lot of sense, and it is understandable that it will need serious GPU power and large amounts of video RAM. But I would like that XAML applications were able to "degrade gracefully" on older hardware.

Moving to MSDN

I haven't decided yet, but it is very likely that I will stop blogging here for some time. For some background, I have moved to the sate...