| | |
Can you fix the problem
![]() |
•
•
Join Date: Feb 2005
Posts: 16
Reputation:
Solved Threads: 0
Hi,
I have code to open program that work(on attach files).
My problem is when I change code to open another file it error.
Ex:
Right code:
Call Shell(li & "\" & "Program Files\Microsoft Office\Office10\POWERPNT.EXE", 1)
Error code:
Call Shell(li & "\" & "aa.pdf", 1)
Error say:"Invalid procedure call or argument"
I have file on my computer.
Can anyone help me with this problem please?
Thanks!
seyha
I have code to open program that work(on attach files).
My problem is when I change code to open another file it error.
Ex:
Right code:
Call Shell(li & "\" & "Program Files\Microsoft Office\Office10\POWERPNT.EXE", 1)
Error code:
Call Shell(li & "\" & "aa.pdf", 1)
Error say:"Invalid procedure call or argument"
I have file on my computer.
Can anyone help me with this problem please?
Thanks!
seyha
Call statement Transfers control to a Sub procedure, Function procedure, or dynamic-link library (DLL)procedure.
I believe that you cannot use "CALL" to call a file which is not executable.
same goes with SHELL...
Call Shell(AppName, 1) Where AppName contains the path of the Executable file.
try it with any other directory and try calling an executable.. it will work.
If you try calling a .txt or .bmp, it will give you the same error message...
I believe that you cannot use "CALL" to call a file which is not executable.
same goes with SHELL...
Call Shell(AppName, 1) Where AppName contains the path of the Executable file.
try it with any other directory and try calling an executable.. it will work.
If you try calling a .txt or .bmp, it will give you the same error message...
•
•
Join Date: Feb 2005
Posts: 16
Reputation:
Solved Threads: 0
So what can I do with the problem? Can you make the file for me please?
Thanks! I hope will here from you soon.
seyha
Thanks! I hope will here from you soon.
seyha
•
•
•
•
Originally Posted by koolsid
Call statement Transfers control to a Sub procedure, Function procedure, or dynamic-link library (DLL)procedure.
I believe that you cannot use "CALL" to call a file which is not executable.
same goes with SHELL...
Call Shell(AppName, 1) Where AppName contains the path of the Executable file.
try it with any other directory and try calling an executable.. it will work.
If you try calling a .txt or .bmp, it will give you the same error message...
•
•
•
•
Originally Posted by Seyha Eng
So what can I do with the problem? Can you make the file for me please?
Thanks! I hope will here from you soon.
seyha
Try using commondialog controls with FSO (file system objects....)
the problem is you are trying to launch a PDF file, not an EXE file. If you want to open the pdf file, you'll have to use the path to adobe. Something like "c:\program files\adobe\adobe.exe aa.pdf" or something along those lines. the Shell function doesn't decipher extentions. It runs an application. Plain and simple. For a POSSIBLE solution to launching a program based on the extention (in cahoots with the registries, HKCR) you might want to look at the API call "shellexecute." That one does wonders
•
•
•
•
Originally Posted by Comatose
the problem is you are trying to launch a PDF file, not an EXE file. If you want to open the pdf file, you'll have to use the path to adobe. Something like "c:\program files\adobe\adobe.exe aa.pdf" or something along those lines. the Shell function doesn't decipher extentions. It runs an application. Plain and simple. For a POSSIBLE solution to launching a program based on the extention (in cahoots with the registries, HKCR) you might want to look at the API call "shellexecute." That one does wonders
the way to go is the shellexecute api.... it launches the default application for the specified file. It's how a lot of VB app's launch the default web browser to visit a specific URL (or whatever the case may be). ShellExecute is powerful, it can run an EXE or figure out which program to call for a specific extention!
thread reference (possible answer): http://www.daniweb.com/techtalkforums/thread18470.html
thread reference (possible answer): http://www.daniweb.com/techtalkforums/thread18470.html
![]() |
Similar Threads
- how to fix blue screen of death problem (Windows NT / 2000 / XP)
- major problem desktop icons disappeared no easy fix (Windows NT / 2000 / XP)
- Fix Slow File Transfer Problem In Windows Vista (Windows tips 'n' tweaks)
- Erratic CPU usage and explorer.exe error (Windows NT / 2000 / XP)
- how to fix this problem..urgent.. (ASP.NET)
- can't fix this problem dealing w/ in system32\ntoskrnl.exe (Viruses, Spyware and other Nasties)
- How can i fix this problem!!! (Java)
- Ad/Spy/Malware problem that I can't fix (Viruses, Spyware and other Nasties)
- Can someone help me fix my problem (Troubleshooting Dead Machines)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: need help with docking app to side of screen
- Next Thread: Timer Question
| Thread Tools | Search this Thread |
* 6 2007 access activex add age basic beginner birth bmp calculator cd cells.find click client code college connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit excel excelmacro file filename form header iamthwee image inboxinvb internetfiledownload listbox listview liveperson login looping microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading refresh remotesqlserverdatabase report save search sendbyte sites sql sql2008 sqlserver subroutine tags time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






