Failed to create flowsheet object

Discusses use of COCO, the process simulation and modelling software suite from AmsterCHEM, downloadable from http://www.cocosimulator.org

Moderator: jasper

Post Reply
HenkF
Posts: 87
Joined: 24 February 2013, 14:50
Location: Hengelo,NL

Failed to create flowsheet object

Post by HenkF »

Hi, I run into a problem when using COFe.xlt.
When I create a new flosheet within Excel using the COFE template there is no problem : the flowsheet is created, and property and flow data can be used. When I however like to open an existing flowsheet, it shows me the following message - in Dutch : Title: "Failed to create flowsheet object"; message : "Eigenschap Add van klasse OleObjects kan niet worden opgehaald" (in English something like "Property Add of class OleObjects cannot be created /collected"?). I'm using Excel 2010/Windows 7. Does someone have any clues regarding this issue? Thanks!
regards,
Henk
HenkF
Posts: 87
Joined: 24 February 2013, 14:50
Location: Hengelo,NL

Re: Failed to create flowsheet object

Post by HenkF »

...a next messgage screen reads:
Title: "No Flowsheet document"
Message: "COFE Excel documents requiere an excel dcument to be present; the document now will close"
These message are generated while working in Excel.
Henk
User avatar
jasper
Posts: 1129
Joined: 24 October 2012, 15:33
Location: Spain
Contact:

Re: Failed to create flowsheet object

Post by jasper »

I just tried in Office 2010 (Win 8.1) and I cannot get it to fail. So it is hard for me to see what the problem is exactly. The code that calls the Add method (strangely the error message you report appears to indicate that Add is a property, not a method) you can simply see when you hit Alt+F11 to open the VBA editor after creating a document from COFE.xlt.

It is part of the COFE_ReplaceFlowsheetDocument function in the COFEActions module of the macros in the workbook, the specific lines

Code: Select all

  If (prompt.useFile) Then
   Set obj = ws.OLEObjects.Add(, prompt.filebox.Text)
   Set obj = Nothing 'prevent configuration dialog
  Else
   Set obj = ws.OLEObjects.Add("COCO_COFE.Document")
  End If
so it is rather strange that the Else branch works, but the If branch does not work (which is what I understand from your message).

For completeness, the Add method is described here:

http://msdn.microsoft.com/en-us/library ... 14%29.aspx

If you go to the AddIns ribbon in Excel and pick Replace Flowsheet after you created a document with a new flowsheet, does this work? (this calls the same function).
HenkF
Posts: 87
Joined: 24 February 2013, 14:50
Location: Hengelo,NL

Re: Failed to create flowsheet object

Post by HenkF »

Jasper, thanks for your reply and hints.
I guess it has to do with my setup, as at another system it indeed runs OK. Maybe a lost reference?
I'm going to dig deeper in using your suggestions.

Thanks!
Henk
Post Reply

Return to “COCO (AmsterCHEM)”