R
Ryder
Hi all, I am using the shell command to run an executable that in
turns generates an image file which I then want to grab and insert
into a document... using a vba macro.
This all works really well, except that when the time comes to
retrieve the file, it's not there (that is, until the macro ends
execution). I am getting a good return value from the shell command.
The "addpicture" method is failing.
It is not a timing issue. I inserted a 15 second timer to cause the
macro to loop... giving the executable enough time to make the image.
(it does so in under a second).
so for some reason, this scheme seems to be failing due to vba not
allowing the file system to update the contents of the directory... or
something.
Really confused here.
Help!
Thanks!
[begin snippit]
ReturnValue = Shell("c:\Program Files\Image Generator.exe",
1) 'always a good rtn value
[various delay code was tried here, including DoEvents]
If ReturnValue <> 0 Then
ActiveDocument.Shapes(CanvasName).CanvasItems.AddPicture _
FileName:="C:\images\myfile.bmp", _
LinkToFile:=False, SaveWithDocument:=True
end if
turns generates an image file which I then want to grab and insert
into a document... using a vba macro.
This all works really well, except that when the time comes to
retrieve the file, it's not there (that is, until the macro ends
execution). I am getting a good return value from the shell command.
The "addpicture" method is failing.
It is not a timing issue. I inserted a 15 second timer to cause the
macro to loop... giving the executable enough time to make the image.
(it does so in under a second).
so for some reason, this scheme seems to be failing due to vba not
allowing the file system to update the contents of the directory... or
something.
Really confused here.
Help!
Thanks!
[begin snippit]
ReturnValue = Shell("c:\Program Files\Image Generator.exe",
1) 'always a good rtn value
[various delay code was tried here, including DoEvents]
If ReturnValue <> 0 Then
ActiveDocument.Shapes(CanvasName).CanvasItems.AddPicture _
FileName:="C:\images\myfile.bmp", _
LinkToFile:=False, SaveWithDocument:=True
end if