My application scan through the excel files and generate a report having count of Activex controls in each excel file. But while running the tool from client machine we are getting an error on opening the file (for some file not all) and the files are located in the sever side, as follows:
"the rpc server is unavailable (exception from hresult : 0X800706BA)"
Can you please guide me why this happens....
When you first launch Excel programmatically, it connects to Excel via an RPC server. When you close the document, this server gets closed without your application knowing about it.
The solution is to trap an error and re-initialise your Excel object. you will then be able to continue.
I had the same and exact problem and upon searching online, nothing works. So I tried one of the comments to open and close Excel both local and server and it works!
If you have the same problem, try to open Excel or the Excel file you are using and close it.
Then try to run your application again.
User contributions licensed under CC BY-SA 3.0