7

We've inherited a Tridion implementation that is built on VBScript templates and are upgrading it from 2009 to 2011. One of the page templates has the following code:

Set var = CreateObject("DLL.Class")

Which is causing the pages using the template to fail on publish with the error:

Error 429 occurred while rendering the Page: ActiveX component can't create object: 'DLL.Class' (source: Set var = CreateObject("DLL.Class")).

The DLL in question is very simple - just two classes with a handful of methods each - and appears to be registered in the GAC on the original implementation. Thus, the first thing we tried was to register the DLL in the GAC of the new server. We did this using the GACUtil.exe program, but unfortunately this did not resolve the error. Next, we tried to instead register the .dll with COM using regasm /codebase (we took it out of the GAC beforehand), but this did not work either. Next, we recompiled the .dll with the Register for COM Interop option checked and repeated the regasm command, but this also failed to resolve the error. The .dll cannot be registered by using regsvr32.

I suspect that our lack of success is due to my inexperience with how Tridion registers .dlls through VBScript. How exactly is this done?

Worth noting is that the test VBScript can create the object successfully outside of Tridion. My understanding was that using .dlls in Tridion was no different than using them in any other way, but I suppose this is not the case!

  • 2
    Very weird. It is indeed the same, and calling it from a .vbs or a template should have the same results. Are you publishing from the exact same server, or do you have more than one publisher machine? Does it fail on preview too? Template Builder? – Nuno Linhares May 10 '13 at 16:31
  • Set var looks weird in any case, even though I don't think var is a reserved word in VBScript – Dominic Cronin May 11 '13 at 10:03
  • Nuno: The publisher is on the same server. It does indeed fail on preview, as well. Template Builder I have not tried, but since it isn't a compound template (pure VBScript) I'm not sure if I can even examine it in there? Dominic: it isn't called "var" in the actual code - I used generic names for everything in the post to try and help with clarity. :) – NVanderEnde May 13 '13 at 8:16
10

I had the same problem when calling Set var = CreateObject("DLL.Class"). This was happening from Workflow Visio VB Script. I created a simple VB script do the same and object was created without any problem.

After bumping my head against a very hard desk a few times, it dawned on me if I was using the correct version of RegAsm utility to register my DLL. It turned out I was not using the correct RegAsm version. I was using 64bit version of RegAsm to register my DLL instead of 32bit.

After registering my DLL with 32bit RegAsm, I am able to create object using Set var = CreateObject("DLL.Class") from Workflow Visio VB Script.

Hope this helps someone in the future!

6

My suspicion would fall on permissions. Check the logs for DCOM failures.

Tridion doesn't have any magical influence over how CreateObject works. If you can CreateObject("DLL.Class") succesfully from other VBScript code running on the same server, then there's no reason why it can't work just as well from within Tridion.

I'd start by executing your test vbscript with the same credentials as the publisher, and see if you can reproduce the problem outside Tridion. If that's what it is, then it should just be a case of fixing up the DCOM permissions

  • In the error logs, there's nothing about a permissions error - it fails with both the SYSTEM and NETWORK SERVICE users (on publish and preview, respectively). What do you mean by using the same credentials as the publisher? There isn't a specific "publisher" account configured on this server - it uses SYSTEM, which I thought had the same privileges as administrator accounts? Am I mistaken? – NVanderEnde May 13 '13 at 8:41
3

In the Tridion Content Manager configuration MMC console, open the 'Management server settings' and 'Script Extensions'. Add your DLL to the script extension and it should be available in your templates. I assume this setting is there in your old implementation.

  • The OP is instantiating (or trying to) the object in their own code. – Dominic Cronin May 11 '13 at 10:02
  • Dominic is right - this hasn't been added to the SE list on the old implementation. – NVanderEnde May 13 '13 at 8:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.