I have a Sharepoint application for saving selected files on a file server. It is necessary to process the xlsx VBA file macro before loading the file. Since the application uses C #, there are two options and which one is correct:

  1. Is it possible to run a macro in the application itself before saving the file? If so, how?
  2. Maybe it is worth rewriting the VBA macro in C #? But then what should the libraries and example be used if possible?

    1 answer 1

    If you run macros, then this is only Office.Interop , which I strongly advise not to.
    With all the desire, there is hardly any hosting that will allow the use of interop, it is not safe, not reliable and, in principle, an illiterate approach.

    See a similar question: https://ru.stackoverflow.com/a/561129/1426

    I recommend using offline tools that do not require a pre-installed Office.
    In addition to Open XML, I can recommend DocX commercial products Aspose.Words and other analogues: https://stackoverflow.com/q/435323/3189289