Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
..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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Dating a file. | Excel Discussion (Misc queries) | |||
How do I change from american dating to uk dating? | Excel Worksheet Functions | |||
How to update dating? | New Users to Excel | |||
Dating Problem | Excel Programming | |||
dating problems! | Excel Worksheet Functions |