Shell command fails (1 Viewer)

kirkm

Registered User.
Local time
Today, 21:06
Joined
Oct 30, 2008
Messages
1,257
Code:
m = Shell("NOTEPAD.EXE" & Path & "\TempCompare.txt", 1)
I've used this successfully in Access .mdb and Win XP for ages. However in Win10 & .accdb file it is reporting File Not Found error.
Path & "\TempCompare.txt" does exist, so is it Notepad that can't be find? Something to do with .accdn files or Win 10?
Or should it work ok ?
Thanks (Path is Application.CurrentProject.Path)
 

theDBguy

I’m here to help
Staff member
Local time
Today, 02:06
Joined
Oct 29, 2018
Messages
21,467
Hi. Just in case, try adding a space between Notepad.exe and the Folder Path. For example:
Code:
m = Shell("Notepad.exe " & Path & "\filename.txt", 1)
 

kirkm

Registered User.
Local time
Today, 21:06
Joined
Oct 30, 2008
Messages
1,257
Many thanks DBGuy. That was it! I missed the space when I retyped the line. :mad:
 

theDBguy

I’m here to help
Staff member
Local time
Today, 02:06
Joined
Oct 29, 2018
Messages
21,467
Many thanks DBGuy. That was it! I missed the space when I retyped the line. :mad:
Congratulations! Glad to hear you got it to work. Cheers!
 

Isaac

Lifelong Learner
Local time
Today, 02:06
Joined
Mar 14, 2017
Messages
8,777
If there is any chance the variable might have a space in it, you might also consider more quotation marks just in case.
 

Users who are viewing this thread

Top Bottom