PDA

View Full Version : [SOLVED] Background on Excel



Paleo
03-02-2005, 08:41 PM
This is odd!

If I get an empty excel file and save it I have a 13.5 Kb file then I set a 46 Kb JPG image as its background and the file grows to 2 Mb. Any suggestions on what I may do to avoid this crazy size increase (other than not using a background image :D )?:dunno

Jacob Hilderbrand
03-02-2005, 08:51 PM
Put the image in a folder. Set the image as the background when the workbook opens. Remove it when the workbook is saved then re-add it after the workbook is saved (Before Save Event and OnTime).

Paleo
03-02-2005, 08:58 PM
Great idea Jake,

worked just fine, but I wonder if there isnt a way to simply decrease file size determining to dont repeat the background to all rows and columns.

Lets say, we could set to use bakground only for the first 1000 rows. Is it possible?

Jacob Hilderbrand
03-02-2005, 09:06 PM
This is a property of the whole sheet, so I do not believe that it can be applied to part of the sheet. You could hide the Rows and Columns that you are not using, but that won't help for the file size.

Paleo
03-02-2005, 09:08 PM
Ok, well the problem is solved anyway, thanks again.

Jacob Hilderbrand
03-02-2005, 09:10 PM
You're Welcome :beerchug:

Take Care

Paleo
03-03-2005, 05:07 AM
Well, just to help newcomers that reads this I will post my solution than maybe they can use it.:thumb

At This_Workbook


Private Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveSheet.SetBackgroundPicture ("")
ActiveWorkbook.Save
End Sub
Private Sub Workbook_Open()
ActiveSheet.SetBackgroundPicture ("y:\backg\teste.jpg")
End Sub


Anyway, if someone have a better solution, please post it here to us all.