Last post Jul 11, 2017 02:33 PM by mgebhard
Jul 11, 2017 06:15 AM|miltank09|LINK
I found a code in c# but I want it in VB, I would like to detect what is on the subject and if not it creates an OpenOffice Calc file.
Jul 11, 2017 06:22 AM|PatriceSc|LINK
Which "subject" ? If you want to create an Excel file server side you would use rather something like the "OpenXML SDK" and you won't really have to care if Excel is installed client side.
Edit: see for example https://github.com/OfficeDev/Open-XML-SDK
Jul 11, 2017 07:59 AM|oned_gk|LINK
Afaik, C# code and VB code just deferent style.
If you show the found code in C#, maybe we can help to convert it manualy to vb.
or you can try online converter
Jul 11, 2017 01:02 PM|miltank09|LINK
This is the code:Type officeType = Type.GetTypeFromProgID("Excel.Application");
if (officeType == null)
//no Excel installed
Jul 11, 2017 02:33 PM|mgebhard|LINK
This is an ASP support forum which is for web sites. In that context, the posted code runs on a web server. The code is checking if the web server has Excel installed. Is that your intention?
Please see PatriceSc's previous post https://forums.asp.net/post/set/18/2124887/6151630 for building Excel Docs on a Web Server.
Keep in mind, a Web Server cannot check what applications are installed on the client machine.
I believe this is the syntax though...
Dim officeType as Type = Type.GetTypeFromProgID("Excel.Application")
If officeType is Nothing Then
'no Excel installed