How can I solve the error of Aspen Hysys case opening "Invoke Error, Dispatch Exception: Access is denied."
9 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Dear,
I am using MATLAB 2016a and Aspen HYSYS V9. I am trying to connect between two program and encounter the error as following:
>> hysys=actxserver('Hysys.Application')
hysys =
COM.Hysys_Application
>> simcase=hysys.SimulationCases.Open([cd,'\an.hsc']);
Error using Interface.HYSYS_9_Type_Library.SimulationCases/Open
Invoke Error, Dispatch Exception: Access is denied.
I tried to run MATLAB as Administrator but the result was still the same. I put the an.hsc file in MATLAB path.
Please kindly help me solve this error. Thank you very much for your help.
2 comentarios
Zain Javed
el 26 de Mayo de 2020
Hi! If you get your answer so please help the people like me so we can make this world a better place with our projects.
Thanks
Hossein Hanzali
el 8 de Dic. de 2023
I have the same problem, the .m file and .hsc files are in the same folder. I tried a lot but not solved. please return the answer to me if the problem solved
Respuestas (3)
Rasel Ahmed
el 26 de Ag. de 2020
Put both files, Hysys simulation case (.hsc) & the following matlab script (.m) in the same folder. Matlab Code, please modify simulation name ("Distill_Example.hsc") accondingly:
Hysys=actxserver('Hysys.Application.V10.0'); %COM Technology
[stat,mess]=fileattrib; %getting actual folder name
simcase = Hysys.SimulationCases.Open([mess.Name '\Distill_Example.hsc']); %Opening HYSYS Simulation (Distill_Example.hsc)
simcase.invoke('Activate'); %Opening HYSYS Simulation (Distill_Example.hsc)
Typically, "Error using interface" can be generated due to lack of Hysys License, therefore the program cannot initialize.
If the error persists, you can send me the simulation and I will try to make the Matlab-Sim Hysys connection.
Regards,
Andrés Abril
for details discussion, please follow this link.
0 comentarios
Francesco Catena
el 28 de Sept. de 2022
Hi,
The .m file and the .hsc file have to be in the same folder. Then you can proceed as follow:
Hysys = actxserver('Hysys.Application.V11.0');
FileNamePath = 'File_name';
Simulation = Hysys.SimulationCases.Open([cd,strcat('\',FileNamePath,'.hsc')]);
Simulation.Visible = true;
Components = Simulation.Flowsheet.Operations;
Streams = Simulation.Flowsheet.MaterialStreams;
Fluxes = Simulation.Flowsheet.EnergyStreams;
Best regards,
Francesco
0 comentarios
Ver también
Categorías
Más información sobre Introduction to Installation and Licensing en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!