Opening a program from within Access

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In my application I need to open a program to view a picture, I have used
some code that John nurick posted, but I can't get it to work, it is:

Dim strPicture As String
Dim strViewer As String
strViewer = "C:\Program Files\ACD Systems\ACDSee\5.0\ACDSee5.exe"
strPicture = Me![ImgControl].Picture
Shell """" & strViewer & """ """ & strPicture & """", vbNormalFocus

This code runs when I double click on the picture held in ImgControl, and by
using a couple of message boxes, I know that the values of strViewer and
strPicture are correct.
When I double click, nothing appears to happen, although I know the code is
actually being executed.
My suspicion i is that there's something wrong with the syntax of the
'Shell' line, but I can't see it - maybe another pair of eyes will see
something I didn't.

Thanks

Neil
 
In my application I need to open a program to view a picture, I have used
some code that John nurick posted, but I can't get it to work, it is:

Dim strPicture As String
Dim strViewer As String
strViewer = "C:\Program Files\ACD Systems\ACDSee\5.0\ACDSee5.exe"
strPicture = Me![ImgControl].Picture
Shell """" & strViewer & """ """ & strPicture & """", vbNormalFocus

This code runs when I double click on the picture held in ImgControl, and by
using a couple of message boxes, I know that the values of strViewer and
strPicture are correct.
When I double click, nothing appears to happen, although I know the code is
actually being executed.
My suspicion i is that there's something wrong with the syntax of the
'Shell' line, but I can't see it - maybe another pair of eyes will see
something I didn't.

Thanks

in my case it's working (I use Version 4 of ACDSee)

copy the shell string into a dos-box and see if it's starting from
there
 
Thanks Andi,

I had a go at doing it in a DOS window and it didn't work there either, got
a message saying:

'c:\Program' is not recognised as an internal or external command, operable
program or batch file.

Weird that it works with V4.0, think I'll have to explore other solutions.

Neil
Andi Mayer said:
In my application I need to open a program to view a picture, I have used
some code that John nurick posted, but I can't get it to work, it is:

Dim strPicture As String
Dim strViewer As String
strViewer = "C:\Program Files\ACD Systems\ACDSee\5.0\ACDSee5.exe"
strPicture = Me![ImgControl].Picture
Shell """" & strViewer & """ """ & strPicture & """", vbNormalFocus

This code runs when I double click on the picture held in ImgControl, and by
using a couple of message boxes, I know that the values of strViewer and
strPicture are correct.
When I double click, nothing appears to happen, although I know the code is
actually being executed.
My suspicion i is that there's something wrong with the syntax of the
'Shell' line, but I can't see it - maybe another pair of eyes will see
something I didn't.

Thanks

in my case it's working (I use Version 4 of ACDSee)

copy the shell string into a dos-box and see if it's starting from
there
 
Thanks Andi,

I had a go at doing it in a DOS window and it didn't work there either, got
a message saying:

'c:\Program' is not recognised as an internal or external command, operable
program or batch file.

Weird that it works with V4.0, think I'll have to explore other solutions.

this has nothing to do with the version of ACDSee

it's a problem with your blank in Program Files

"C:\Program Files\ACD Systems\ACDSee\ACDSee.exe" "D:\A\Ethernet.JPG"

this should be the string, which you shold try in the DOS Box (with
your PathName of your ACDSee

you see: it is in Quotes, because a blank is the end of the command
and the rest would be a parameter.
 
Now I'm starting to get somewhere!

When I run from DOS I get an error message saying that ACDsee can't find a
certain dll in a list if about six different directories.
The dll is present, but in a different folder (c:\Program File\Common
Files\ACD Systems) which isn't on the list that the program is looking for.

I'm unable to move the .dll, which I wouldn't want to do anyway, because we
have around 200 machines all with the same installation of ACDSee, so now all
I need to do is work out how I get the dll reference set up - have passed
that one over to my IT dept to see if they can help!

Neil
 
Now I'm starting to get somewhere!

When I run from DOS I get an error message saying that ACDsee can't find a
certain dll in a list if about six different directories.
The dll is present, but in a different folder (c:\Program File\Common
Files\ACD Systems) which isn't on the list that the program is looking for.

I'm unable to move the .dll, which I wouldn't want to do anyway, because we
have around 200 machines all with the same installation of ACDSee, so now all
I need to do is work out how I get the dll reference set up - have passed
that one over to my IT dept to see if they can help!

Another hint:

look in the Icon on the Desktop: there is a start-up-Folder

try it in the Dos_window from this folder

if this is working then you have to set the currentdir

ChDir and ChDrive will help you
 
We were almost there with that one, The startup folder for ACDsee is the same
folder as the ACDsee5.exe file I found the folder the dll is in and tried
starting from there instead, I didn't get a message saying it couldn't find
that .dll buT another one instead. Think I've entered 'dll Hell', and I was
about to give up and use 'Paint' instead, when I discovered that the IT dept.
aren't installing Paint on any new PC's they install!

Giving up time is very close indeed.

Neil
 
We were almost there with that one, The startup folder for ACDsee is the same
folder as the ACDsee5.exe file I found the folder the dll is in and tried
starting from there instead, I didn't get a message saying it couldn't find
that .dll buT another one instead. Think I've entered 'dll Hell', and I was
about to give up and use 'Paint' instead, when I discovered that the IT dept.
aren't installing Paint on any new PC's they install!
whats happend if you double Click an image?

is ACDSee the default for the images?
if yes then try:
shell chr(34) &environ("comspec") &chr(34) &" /c " _
&"D:\A\Ethernet.JPG"

this is the same as "D:\A\Ethernet.JPG" in a command-window
 
Back
Top