cancel
Showing results for 
Search instead for 
Did you mean: 

I created a copy of Word & Excel VBO's to house our custom actions, now I get the error 'Create_Instance' is not declared. It may be inaccessible due to its protection level.

PatrickOttery1
Level 4
To allow us to add our own Excel & Word VBO actions, but to avoid the de-merging/re-merging hell that comes if upgrading VBO's, I've created copies of any VBO's we wish to extend. I intentionally created the copies, so that I could retain all the global code, etc. I've since deleted any original published actions, and have added any new actions into these new objects. However, I am getting a compile error on both of the new Word & Excel VBO's "Compiler error at line 100: 'Create_Instance' is not declared. It may be inaccessible due to its protection level." I have double checked all external references and namespace imports. They are the same as the original objects. Any thoughts? I think there's something else fishy going on.  
4 REPLIES 4

PatrickOttery1
Level 4
Yep, something fishy with the way Blue Prism handles global code in a copied object. I manually created a brand new object, then manually pasted in all the exact same global code, assembly references and namespace imports and everything is working just fine. I'm using v5.0.30, but we're soon upgrading to v6.4. I this a known bug? Is it fixed in v6.4 and up? Regards, Patrick.

DaveMorris
Level 14
Hi Patrick, First, let me mention that I don't know why this is a thing and I agree with you that it's odd. But, it seems that function references in the Global Code can actually point to Code Stages across the VBO. This blew my mind when I realized it, but I guess it makes a kind of sense. Notice that the Code Stage 'Create Instance' on the page 'Create Instance' has a space in it. The function reference in the global code has an underscore so that it is valid in the VB.NET code: 'Create_Instance()'. There are two ways to fix the issue. One, you could delete all the global code that is interdependent, surrounding that function. This is what I did because in our Wrapper objects, we aren't using any of the global code. Or Two, you could put the code stage back for 'Create Instance'. Both of these will remove the Compiler Error. Dave
Dave Morris 3Ci at Southern Company Atlanta, GA

PatrickOttery1
Level 4
Hi Dave, thanks for taking a look. This is fully resolved if I simply create a blank object, then manually import all the global code, etc. The issue only came about when duplicating the object and removing the actions I did not need. I did try deleting all the global code, then re-importing and it didn't change the behaviour. I believe there must be a reference to the original object guid within the new object.  At this point, I don't have the time to fully investigate and raise a bug, but I'd suggest it's something worth your time to investigate yourselves. Regards, Patrick.

PatrickOttery1
Level 4
Hi Dave, Apologies, I was incorrect with my above statement. Working all weekend with a cold had my thinking sideways. I've followed your advice and things are indeed now running as required. Thanks again for your help. Regards, Patrick.