简体   繁体   中英

How to check whether installed Excel is Licensed or not?

I am Creating an application which is responsible to read or right Excel files. Below code give me whether Excel is installed or not. Is there any Provision to check the installed excel is Registered/Licensed?

Type officeType = Type.GetTypeFromProgID("Excel.Application");
if (officeType == null)
{
     //no Excel installed
}
else
{
     //Excel installed
}

You could check if there is a key in the registry

There is a Script that can do so for Office for example

Open an administrative level command prompt. Navigate to the Office14 folder:

32bit Office on 64bit OS – “cd \Program Files (x86)\Microsoft Office\Office14”
32bit Office on 32bit OS and 64bit Office on 64bit OS – “cd \Program Files\Microsoft Office\Office14”

Execute “cscript ospp.vbs /dstatus”

The script searches somewhere around here for my Office version

HKLM\SOFTWARE\Microsoft\Office\15.0\ClickToRun\Configuration\SharedComputerLicensing
HKLM\SOFTWARE\Microsoft\Office\ClickToRun\Configuration\SharedComputerLicensing

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM