Compile Error: 'CreateObject' is not declared. It may be inaccessible due to its protection level.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
14-03-17 12:03 AM
Hello,
We are trying to create an instance of Excel the same way as the MS Excel VBO is doing it with the following line of code:
Dim excel as Object = CreateObject("Excel.Application")
We are running into the following error message:
Compile Error at line 1: 'CreateObject' is not declared. It may be inaccessible due to its protection level.
I cannot find any place that has Import statements or added references in the MS Excel VBO. What am I missing? I am also getting the same error for other system functions like handle = GetHandle(excel).
Thanks,
Jay
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
14-03-17 01:20 PM
CreateObject is a VB function, and in the original VBO you'll see Microsoft.VisualBasic in the Namespace Imports. GetHandle is a function in the Glocbal Code section of the VBO.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
14-03-17 06:22 PM
I was expecting to find Imports somewhere, but searched all over Object Studio and still can't find them. Do we need to use something besides Object Studio to see the Global Code section and namespace imports?
EDIT: Found documentation for adding .NET code (https://portal.blueprism.com/system/files/product/productpublic/4.2/Blu). I see the Business Object Properties form, but do not see a way to launch it. Is it launched from Blue Prism or Object Studio...is there a user access level that could prevent someone from seeing it?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
14-03-17 09:03 PM
It's in the properties of the page details box on the Initialise page. In there you'll see a tab for references and imports, and a tab for global code.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
14-03-17 09:33 PM
Perfect, that was what I was missing. I took that as a note and was looking elsewhere. Thank you for the help.