ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Code to instruct "Insert new disk" (https://www.excelbanter.com/excel-programming/379546-re-code-instruct-insert-new-disk.html)

JakeyC

Code to instruct "Insert new disk"
 

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

Code to instruct "Insert new disk"
 
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.




All times are GMT +1. The time now is 09:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com