How i can connect to microsoft excel with zemax?
Best answer by Csilla Timar-Fulep
View originalHow i can connect to microsoft excel with zemax?
Best answer by Csilla Timar-Fulep
View originalHi Pascal,
Thanks for your follow-up question here.
For more info about how to use Excel specifically, I would recommend to check these knowledgebase articles and forum threads:
Required OpticStudio version and language for using ZOS-API · MyZemax
ZOS-API & Excel interactive extension example- retrieve incident angles on surfaces across pupil · MyZemax
The problem with microsoft excel Connect to ZEMAX · MyZemax
Regarding the API-specific commands, these are usually very similar across the programming languages. To learn more about the syntax, please take a look at the following ZOS-API learning path and these knowledgebase articles:
Getting Started with ZOS-API · MyZemax
Sample code for ZOS-API users · MyZemax
Navigating the ZOS-API Syntax Help document - Part 1 · MyZemax
Finally, I am attaching 2 sample codes written by my colleagues.
Best,
Csilla
THANK YOU
Hello Sheng-BO,
Thanks for your question here!
You can connect to Excel throught ZOS-API. The communication between Excel and ZOS-API is easy once you have the references enabled in Visual Basic for Applications environment. To do so, open VBA (Alt+F11 from any Excel sheet), then click on Tools > References and finally scroll down to the bottom of the list and select ZOSAPI and ZOSAPI_Interfaces:
From here, you can create a new Module and create your subroutines.
There are a few things to note, please see them below:
If you have further questions, please let us know and we will be happy to help!
Best,
Csilla
Hi Csilla,
Using Excel to communicate with Zemax is very interesting for me.
This because I'm familiar with VBA but not as much with the other languages.
Can you provide me with some examples of how VBA is used so that I can learn about the syntax details?
Hope you can help me.
The best regards
Pascal
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.