View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Bill Pfister Bill Pfister is offline
external usenet poster
 
Posts: 132
Default runtime err 76 on some laptops

Unfortunately, I don't know all the implications of autorunning, but you
should be able to determine the absolute path by writing some detective
routines that leverage other aspects of the FileSystemObject object.

GetAbsolutePathName on the source folder should allow you to catch the error
immediately. You can then use the Drives and DriveType properties to narrow
the list of CD drives (if the machines are all undocked laptops, the
probability of multiple cd/dvd drives is reasonably low). If they are docked
(which is something you can programmatically confirm), then you can search
for drives with media present. Once the drives are determined (if you're
lucky, there is only one), you can search the drives for specific media/files.


"Marvin" wrote:

Yes it always exists. What I discovered is that this error occurs when the
user has autorun turned off and then tries to run the installation
spreadsheet manually. Since I did not know the path of the CD/DVD drive spec
on everyone's machine I left it out of the path name. Apparently when the
installation spreadsheet is not run from the autorun file, the copyfolder
command fails. I am not sure why this happens since the default drive is
selected by the user to get to the installation program so I would think that
this would not be a problem.

"Bill Pfister" wrote:


Marvin, are you certain the source folder "CMA_Camera_Pictures" always exists?


"Marvin" wrote:

on some laptops the following fails with a 76 run time eror on the copyfolder
line

Set FsO = CreateObject("Scripting.FileSystemObject")
sourceFolder = "CMA_Camera_Pictures"
destFolder = "C:\CRISNET\EXPORT\CMA_Camera_Pictures"
FsO.CopyFolder sourceFolder, destFolder, True

in all cases, C:\CRISNET\EXPORT already exists. Anyone have any ideas?