Connection Excel on another computer

All topics on coding 4Dscript in Enterprise Dynamics.
Post Reply
Roma
Posts: 6
Joined: Monday 08 July, 2013 - 10:54

Connection Excel on another computer

Post by Roma »

Hello Community!

Last time you've helped me in a great way, so hopefully you can do the same this time!

This time I'm stuck with the following, my model works great, but I want to open it on another computer.
My model excist of a .Mod file and an Excel File for input and output. I'm using a connection by ActiveX with Excel).

So in my code there are lines like
ExcelActiveX_Open([C:\Users\Roel\Desktop\Enterprise Dynamics Files\filename.xlsx], 0, InputAtoom),

If I send the file to a different computer I need to adjust those filenames manually, and I hope there is a way that is is done automatically....., if both files are in the same map on the arriving computer.

My question is, is it possible to send the Excel file and the Enterprise Dynamic model, and create the same connection on the other computer?

Hope you can help!

Roma
BartC
Posts: 47
Joined: Monday 05 November, 2012 - 17:05

Re: Connection Excel on another computer

Post by BartC »

Hello Roma,

The function CurDir gives a referral to the map of your model, so in your case this is "C:\Users\Roel\Desktop\Enterprise Dynamics Files". You can extend this referral by using your filename as the first parameter of this function. So instead of using ExcelActiveX_Open([C:\Users\Roel\Desktop\Enterprise Dynamics Files\filename.xlsx], 0, InputAtoom), use:

Code: Select all

ExcelActiveX_Open(CurDir([filename.xlsx]), 0, InputAtoom)
This should do the trick.

Regards,

Bart
Roma
Posts: 6
Joined: Monday 08 July, 2013 - 10:54

Re: Connection Excel on another computer

Post by Roma »

Ha Bart,

Thank you very much! Exactly what I was looking for!
Roma
Post Reply