![]() |
Title bar not up-dating after running the macro below
Title bar (at the very top in blue) doesn’t update.
The macro below nearly does what I want – but after the save has taken place the Title bar still shows the previous file name. I need it to up date. John Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) mydrive = "H:" mydir = "Temp" myname = Sheets("sheet1").Range("a1") ms = mydrive & "\" & mydir & "\" & myname & ".xls" ActiveWorkbook.SaveCopyAs Filename:=ms Cancel = True ActiveWorkbook.Saved = True msg = MsgBox("The workbook has been saved as " & ms, vbInformation + vbOKOnly, "Save As") End Sub |
Title bar not up-dating after running the macro below
You're using .savecopyas in your code.
That means that you're saving a copy of the file as a new name -- it's not being opened and that's why the caption doesn't change. On 10/03/2010 05:40, Johnnyboy5 wrote: Title bar (at the very top in blue) doesn’t update. The macro below nearly does what I want – but after the save has taken place the Title bar still shows the previous file name. I need it to up date. John Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) mydrive = "H:" mydir = "Temp" myname = Sheets("sheet1").Range("a1") ms = mydrive& "\"& mydir& "\"& myname& ".xls" ActiveWorkbook.SaveCopyAs Filename:=ms Cancel = True ActiveWorkbook.Saved = True msg = MsgBox("The workbook has been saved as "& ms, vbInformation + vbOKOnly, "Save As") End Sub -- Dave Peterson |
Title bar not up-dating after running the macro below
On 3 Oct, 13:00, Dave Peterson wrote:
You're using .savecopyas in your code. That means that you're saving a copy of the file as a new name -- it's not being opened and that's why the caption doesn't change. On 10/03/2010 05:40, Johnnyboy5 wrote: Title bar (at the very top in blue) doesn’t update. The macro below nearly does what I want – but after the save has taken place the Title bar still shows the previous file name. I need it to up date. John Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) mydrive = "H:" mydir = "Temp" myname = Sheets("sheet1").Range("a1") ms = mydrive& *"\"& *mydir& *"\"& *myname& *".xls" ActiveWorkbook.SaveCopyAs Filename:=ms Cancel = True ActiveWorkbook.Saved = True msg = MsgBox("The workbook has been saved as "& *ms, vbInformation + vbOKOnly, "Save As") End Sub -- Dave Peterson Ah - right - so is there anything I can change to have the title bar update. Not use SaveCopyAs ?? John |
Title bar not up-dating after running the macro below
..SaveAs
The existing file won't be changed, but the workbook you're updating will now be the new name. See VBA's help for all the parms you need to supply. On 10/03/2010 07:17, Johnnyboy5 wrote: On 3 Oct, 13:00, Dave wrote: You're using .savecopyas in your code. That means that you're saving a copy of the file as a new name -- it's not being opened and that's why the caption doesn't change. On 10/03/2010 05:40, Johnnyboy5 wrote: Title bar (at the very top in blue) doesn’t update. The macro below nearly does what I want – but after the save has taken place the Title bar still shows the previous file name. I need it to up date. John Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) mydrive = "H:" mydir = "Temp" myname = Sheets("sheet1").Range("a1") ms = mydrive& "\"& mydir& "\"& myname& ".xls" ActiveWorkbook.SaveCopyAs Filename:=ms Cancel = True ActiveWorkbook.Saved = True msg = MsgBox("The workbook has been saved as "& ms, vbInformation + vbOKOnly, "Save As") End Sub -- Dave Peterson Ah - right - so is there anything I can change to have the title bar update. Not use SaveCopyAs ?? John -- Dave Peterson |
Title bar not up-dating after running the macro below
On 3 Oct, 17:00, Dave Peterson wrote:
.SaveAs The existing file won't be changed, but the workbook you're updating will now be the new name. See VBA's help for all the parms you need to supply. On 10/03/2010 07:17, Johnnyboy5 wrote: On 3 Oct, 13:00, Dave *wrote: You're using .savecopyas in your code. That means that you're saving a copy of the file as a new name -- it's not being opened and that's why the caption doesn't change. On 10/03/2010 05:40, Johnnyboy5 wrote: Title bar (at the very top in blue) doesn’t update. The macro below nearly does what I want – but after the save has taken place the Title bar still shows the previous file name. I need it to up date. John Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) mydrive = "H:" mydir = "Temp" myname = Sheets("sheet1").Range("a1") ms = mydrive& * *"\"& * *mydir& * *"\"& * *myname& * *".xls" ActiveWorkbook.SaveCopyAs Filename:=ms Cancel = True ActiveWorkbook.Saved = True msg = MsgBox("The workbook has been saved as "& * *ms, vbInformation + vbOKOnly, "Save As") End Sub -- Dave Peterson Ah - right - so is there anything I can change to have the title bar update. *Not use SaveCopyAs *?? John -- Dave Peterson Thanks - SaveAs still presents the same issue in that the file is saved but the name in the title bar stays the same whatever you call the saved file John |
Title bar not up-dating after running the macro below
I think you should share your code and share what was in the titlebar before and
after the saveas. On 10/03/2010 13:50, Johnnyboy5 wrote: <<snipped Thanks - SaveAs still presents the same issue in that the file is saved but the name in the title bar stays the same whatever you call the saved file John -- Dave Peterson |
All times are GMT +1. The time now is 01:09 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com