Problem with picture in header

W

Wolfram Fuchs

With OS 10.4.3 installed on a G4 1,33 GHz PowerBook I created an Excel
template with our companies logo integrated as png picture in the page
set-up header. After storing the template I duplicated the xlt-file twice,
renamed it to worksheet and workbook and stored these files inside the Excel
start folder. The idea is, to have the logo integrated in the header
whenever I create a new workbook or add a new sheet to an existing workbook.
It works when I open create a new workbook by starting the excel template or
using command-n. Excel crashes whenever I add a new worksheet to any
existing workbook, even if it was created with the templates.
Any idea?
Thanks from Munich
Wolfram
 
J

JE McGimpsey

Wolfram Fuchs <[email protected]> said:
With OS 10.4.3 installed on a G4 1,33 GHz PowerBook I created an Excel
template with our companies logo integrated as png picture in the page
set-up header. After storing the template I duplicated the xlt-file twice,
renamed it to worksheet and workbook and stored these files inside the Excel
start folder. The idea is, to have the logo integrated in the header
whenever I create a new workbook or add a new sheet to an existing workbook.
It works when I open create a new workbook by starting the excel template or
using command-n. Excel crashes whenever I add a new worksheet to any
existing workbook, even if it was created with the templates.

It's a bug.

Here's one workaround I've used. It's ugly with all the flickering, but
it works:

Public Sub InsertWorksheetWithGraphicHeader()
Dim wsActive As Worksheet
Dim sPath As String
Dim sName As String
Dim n As Long
Set wsActive = ActiveSheet
With Application
sPath = IIf(.AltStartupPath = "", .StartupPath, _
.AltStartupPath) & .PathSeparator & "Sheet"
End With
If Dir(sPath) = "" Then
Worksheets.Add Before:=wsActive
Else
With Workbooks.Add(sPath)
.Sheets(1).Copy Before:=wsActive
With ActiveSheet
n = 0
On Error Resume Next
Do
n = n + 1
sName = "Sheet" & n
.Name = sName
Loop Until .Name = sName
On Error GoTo 0
End With
.Close SaveChanges:=False
End With
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top