[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.excel.programming

Code to instruct "Insert new disk"

Jim Jackson

12/15/2006 7:51:00 PM

I have searched VBA Help and this forum but cannot find any hint to what I
need. I have written a routine that backs up selected file types to the
drive chosen by the user. I found that, when including jpeg files, the CD
fills up rather quickly.

The macro hung up and I was forced to re-boot to regain control. Is there
code that will recognize that the next file is too large for the available
space and allow a change of disks?

Thanks.
--
Best wishes,

Jim
2 Answers

JakeyC

12/16/2006 1:39:00 AM

0


Jim Jackson wrote:
> I have searched VBA Help and this forum but cannot find any hint to what I
> need. I have written a routine that backs up selected file types to the
> drive chosen by the user. I found that, when including jpeg files, the CD
> fills up rather quickly.
>
> The macro hung up and I was forced to re-boot to regain control. Is there
> code that will recognize that the next file is too large for the available
> space and allow a change of disks?
>
> Thanks.
> --
> Best wishes,
>
> Jim

An interesting problem. I've never tried automating saving to multiple
disks, but perhaps you could work around the problem by first knowing
the capacity of the drive/disk, then, explicitly save each file one at
a time, but whilst detecting their respective sizes (search for info on
using the FileSystem object for this).

As soon as you encounter a file that exceeds the remaing capacity of
the disk, you can enter a DoEvents loop after prompting the user to
swap the disks, then continue from the file you left off at once the
disk is changed.

Pops Jackson

12/17/2006 1:21:00 PM

0

You are right on the button. Using AvailableSpace I can write the lines
needed to trigger the msgbox and allow changing discs.

Thanks,
--
Pops Jackson


"JakeyC" wrote:

>
> Jim Jackson wrote:
> > I have searched VBA Help and this forum but cannot find any hint to what I
> > need. I have written a routine that backs up selected file types to the
> > drive chosen by the user. I found that, when including jpeg files, the CD
> > fills up rather quickly.
> >
> > The macro hung up and I was forced to re-boot to regain control. Is there
> > code that will recognize that the next file is too large for the available
> > space and allow a change of disks?
> >
> > Thanks.
> > --
> > Best wishes,
> >
> > Jim
>
> An interesting problem. I've never tried automating saving to multiple
> disks, but perhaps you could work around the problem by first knowing
> the capacity of the drive/disk, then, explicitly save each file one at
> a time, but whilst detecting their respective sizes (search for info on
> using the FileSystem object for this).
>
> As soon as you encounter a file that exceeds the remaing capacity of
> the disk, you can enter a DoEvents loop after prompting the user to
> swap the disks, then continue from the file you left off at once the
> disk is changed.
>
>