I'm getting error on winform application on windows 10

0

I get this error when using windows 10.

System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'Shell32.Shell'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{34936BA1-67AD-4C41-99B8-8C12DFF1E974}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

my code:

Dim shell As New Shell32.Shell
Dim objFolder As Shell32.Folder
Dim objItem As Shell32.FolderItem
Dim propertyValue As String = Nothing
Dim propertyName As String = Nothing

objFolder = shell.NameSpace("myFilepath")
objItem = objFolder.ParseName("file.xlsx") 

Works fine on windows 7. Is there anyway to make it work on windows 7 and windows 10?

vb.net
asked on Stack Overflow Aug 1, 2017 by pokemon_Man • edited Aug 1, 2017 by pokemon_Man

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0