cancel
Showing results for 
Search instead for 
Did you mean: 

Compile Error: 'CreateObject' is not declared. It may be inaccessible due to its protection level.

JayBorden
Level 3
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

John__Carter
Staff
Staff
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.

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?

John__Carter
Staff
Staff
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.

Perfect, that was what I was missing. I took that as a note and was looking elsewhere. Thank you for the help.