Copying a background with a 'sheet.copy' macro


Posted by Garland on February 25, 2001 7:59 PM

I am using a 'sheet.cells.copy' based macro to clone
a master sheet for an attendance log. When a new sheet
is created, however, the background on the master sheet
is not transferred to the new sheet. Is there a way to
do this using VBA?

Posted by David Hawley on February 26, 2001 1:41 AM


Hi Garland

You cannot actually Copy a background via the cliboard, but you can insert it again via VBA:

ActiveSheet.SetBackgroundPicture Filename:= _
"C:\My Documents\My Pictures\AlanNewYear.jpg"


Any Good ?

Dave

OzGrid Business Applications



Posted by Garland on February 26, 2001 6:21 PM

Dave,

Thanks very much for responding. The Excel
Workbook I am developing will reside on a national
main frame computer. Users will open the program
from there and it will save to their workstation
PC. I am trying to avoid using any 'companion'
files that to accomodate the desire to have a
consistent background as each new sheet is
created by the user.

I am puzzled by the mechanism in which a back-
ground is captured by Excel in the first place.
Once it is set, it is transportable to any PC even
those that do not have the jpeg file resident.

That is why I had hoped that it could be
replicated from the master sheet, once it was set.

Oh well, I guess it was not meant to be.

Thanks anyway...

Garland