Check if Excel Installed

serkan sendur 0 Tallied Votes 463 Views Share

three lines of code to check MS Excel is installed on PC

RegistryKey key = Registry.ClassesRoot;
			RegistryKey excelKey = key.OpenSubKey("Excel.Application");
			bool excelInstalled = excelKey == null ? false : true;
serkan sendur 821 Postaholic Banned

i forgot to say that you have to add Microsoft.Win32 namespace

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.