Can't load xll programmatically

前端 未结 5 529
青春惊慌失措
青春惊慌失措 2021-01-14 12:40

I\'m trying to automating some tests for an Excel add-in, which is in xll form. I have some problem in loading the xll. I\'m writing it in C# and my code looks like this:

5条回答
  •  旧时难觅i
    2021-01-14 13:08

    Yes, the ChDir command can be important. It helps Windows find any DLLs that whatever.xll depends on. The reason it doesn't solve your problem is that FileSystem.ChDir() changes the working directory for your test program, not for Excel.

    Not a wholeheckofalot you can do. Deploying the xll do a directory that's on the system's PATH will solve it. A pragmatic solution is to just run that macro.

提交回复
热议问题