Excel VBA SHELL function does not work anymore

%3CLINGO-SUB%20id%3D%22lingo-sub-1605266%22%20slang%3D%22en-US%22%3EExcel%20VBA%20SHELL%20function%20does%20not%20work%20anymore%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1605266%22%20slang%3D%22en-US%22%3E%3CP%3ERecently%20I%20switched%20from%20Windows%207%20to%20Windows%2010%20and%20I%3C%2FP%3E%3CP%3Euse%20Excel%202016.%20With%20W7%20the%20VBA%20'SHELL'%20function%20worked%20fine%2C%20but%20now%20I%20get%20an%20error%20message%20(error%20code%205).%20I%20am%20using%20the%20same%20Excel%20worksheet%20as%20with%20W7.%3C%2FP%3E%3CP%3EWhy%20does%20this%20simple%20script%20work%20in%20Excel%20and%20W7%20and%20not%20in%20Excel%20and%20W10%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-visual%22%3E%3CCODE%3ESub%20openP3d()%0A%0A'%20openen%20van%20P3d%0A%0AShell%20(%22C%3A%5CP3d%5CPrepar3D.exe%22)%0AEnd%20Sub%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDoes%20anyone%20have%20any%20suggestion%20to%20fix%20this%20problem%3F%3C%2FP%3E%3CP%3EMany%20thanks%20in%20advanced%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Visitor

Recently I switched from Windows 7 to Windows 10 and I

use Excel 2016. With W7 the VBA 'SHELL' function worked fine, but now I get an error message (error code 5). I am using the same Excel worksheet as with W7.

Why does this simple script work in Excel and W7 and not in Excel and W10?

 

Sub openP3d()

' openen van P3d

Shell ("C:\P3d\Prepar3D.exe")
End Sub

 

Does anyone have any suggestion to fix this problem?

Many thanks in advanced

 

 

0 Replies