Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 420
Default 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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default 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
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 420
Default 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
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default 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


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 420
Default 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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dating a file. Matt S Excel Discussion (Misc queries) 4 July 22nd 08 06:57 PM
How do I change from american dating to uk dating? Ile Esturo Excel Worksheet Functions 1 November 28th 06 04:45 PM
How to update dating? Craig New Users to Excel 1 October 28th 06 08:09 PM
Dating Problem Gary's Student Excel Programming 4 June 21st 05 12:47 PM
dating problems! Jose Mourinho Excel Worksheet Functions 4 January 12th 05 05:03 PM


All times are GMT +1. The time now is 05:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"