Hi,
Hi,
I have the following code :
[vba]
Public dateup As String
Public wbreport As Workbook
sub test()
Set wbreport = Workbooks.Open(ThisWorkbook.Path & "\" & "Report Model" & ".xls", False, True)
dateup = Right(ThisWorkbook.Sheets("MATRIX").Shapes("Rectangle 7").TextFrame.Characters.Text, 7)
With wbreport.Sheets("Matrix_EN").PageSetup
.LeftFooter = "Last Update: " & dateup
End With
wbreport.SaveAs (reportsavepath & "\" & "Report Revision " & dateup & ".xls")
end sub
[/vba]
With the code as is, Excel crash completly when reading this line.
[vba]
wbreport.SaveAs (reportsavepath & "\" & "Report Revision " & dateup & ".xls")
[/vba]
The weird thing is, if I remove this line :
[vba]
With wbreport.Sheets("Matrix_EN").PageSetup
.LeftFooter = "Last Update: " & dateup
End With
[/vba]
I don't get the error anymore.
What is causing this error? Have I declared my variable the wrong way and this is what is causing an error while saving?
I already posted that question on mr.excel forum and will let you know if anyone there finds the answer. Here is the link.
mrexcel (dot) com /forum/showthread.php?t=628996
Thank you for your help!