Показать сообщение отдельно
Старый 17.06.2022, 19:16   #5  
sukhanchik is offline
sukhanchik
Administrator
Аватар для sukhanchik
MCBMSS
Злыдни
Лучший по профессии 2015
Лучший по профессии AXAWARD 2013
Лучший по профессии 2011
Лучший по профессии 2009
 
3,273 / 3466 (122) ++++++++++
Регистрация: 13.06.2004
Адрес: Москва
Цитата:
Сообщение от Raven Melancholic Посмотреть сообщение
Злой Вы. В России давать ссылку на community.dynamics.com без комментария.
Вытащу статью, правда без картинок и ссылок (картинки не грузятся, ссылки не работают)

A few months ago I wrote a post on how to convert Excel documents to PDF with X++. Well, that piece of code made it into production! image But I just notice it does not necessarily compile with Ax Build.
The error:
The xlApp declaration does not compile because Excel is not installed on the server and AX build can only be completed on the server. If you compile this same piece of code in the AOT on a server that has Excel installed, it compiles without a problem.

My solution(s):
Install Excel on the server. I am not sure if this will allow AX Build to compile the code, but at least you can then open the AOT after AX build on the sever and compile like I described here.
Since I could not install Excel on the server, I did the following:
  1. Compile with AX Build on the server.
  2. If you have a compile error related to Microsoft.Office.Interop.Excel, start the server and open the AOT on a terminal server that has Excel installed.
  3. Compile the code with normal F7 compile.
  4. Compile the CIL on the terminal server.
Hope that helps! Let me know in the comments if you know of a better way to solve this.
__________________
Возможно сделать все. Вопрос времени