A Day in the Life

A day in my life. Thoughts on leadership, management, startups, technology, software, concurrent development, etc... Basically the stuff I think about from 10am to 6pm.

6/04/2007

We all need a little help from our friends...

All right all you developers out there...you have GOT to start blogging because I am really tired of running into error messages and situations that I KNOW someone has gotten around but no one has bothered to share the solution for. Now I know for a fact that my blog is not in the top 10000 of blogs that are widely read, but I can tell you from my traffic that my blog does help folks. You can help folks too. Be altruistic and give back to the community, there is so much software left to build that there is no reason to hoard information.

As I was searching Google for the answer to the error message below I saw the same error message pop-up in Groups and on the Web but with no solution ever presented. This is not the first time I've encountered this problem, it won't be the last, but maybe we can change this...one post at a time. Okay, that was my call to arms. Now onto the error message and the solution.

--------------------------

I don't know if my solution will work for you, but here is my situation and the accompanying solution.

I'm trying to open a password protected Excel workbook from a VBScript file. The problem I ran into is that there are "empty parameters" between the filename and the password for the Workbooks.Open call; in C# those empty parameters are filled with the word 'missing', but what to do about VBS?

Here is the error message generated with all my attempts to make the call:

"Unable to get the Open property of the Workbooks class."

Here is the correct syntax:

Set oWorkBook = myExcelWorker.Workbooks.Open
(strWorkerWB, , , , "password")

Where strWorkerWB is a variable containing the name of my Excel workbook, "password" is the Password to open for the workbook, and the command is typed into your script on one line (While the line is split in this post, don't split it in your code).

0 Comments:

Post a Comment

<< Home