Modified Excel VBO - with open password protected Workbook
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
30-10-15 04:15 PM
Attached should be a modified Excel VBO with an extra action to open a password protected Workbook.
Please note that this is supplied "as is" and is not an official part of the Blue Prism product.
There are enhancement requests also logged to add further functionality of this nature and more to the Excel VBO that ships with the product.
Sam
15 REPLIES 15
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
14-07-17 04:21 PM
I amended the code in the existing 'Open Workbook' action as follows where 'password' is a reference to a Password Data Item Input:
Dim wb as Object = GetInstance(handle).Workbooks.Open(filename, Type.Missing, Type.Missing, Type.Missing, password)
name = wb.Name
wb.Activate()
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
17-07-17 03:33 PM
Thanks for posting this niallfee. I just recently figured out the code myself and came here to post it. I'm following more or less the same logic myself but lack knowledge of Visual Basic and I'm not sure what the function of the Type.Missing objects. Would you be able to explain these?
In addition to the above, I included WriteResPassword in my own, if in the case of files having separate write/read credentials. These can be set to whatever data item inputs you need. As a bonus, there's no issue using the amended code if the files you are opening do not have password access enabled.
Dim wb as Object = GetInstance(handle).Workbooks.Open(filename,Password:=(Password),WriteResPassword:=(Password))
name = wb.Name
wb.Activate()
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
18-07-17 02:58 PM
Hi Daragh, I think the Type.Missing just invokes the default value for the parameter at that position. I'm very new to this too so it probably isn't the best way to write it! My code is just using filename for the first parameter, then using Type.Missing to get the default for the next 3 parameters and then using password for the fifth parameter. I guess your approach is explicitly calling out and assigning the password parameters rather than going through the list until it gets to them like mine.
https://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
18-07-17 03:53 PM
OK I think I get where you're coming from.
Thanks!
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
31-07-17 07:02 PM
Hi
can someone forward the VBO to hamid.sabaro@teliacompany.com
Thanks in advance!
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
15-11-17 08:10 PM
If anyone could link the VBO that would be great!
Thanks!

- « Previous
-
- 1
- 2
- Next »