Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 246
Default Full path in taskbar

I have added a Class to my personal.xls which shows the full path of
the workbook in the caption. It all works except when I open a new
workbook. Is there something I am missing? Code below. TIA

Option Explicit
Public WithEvents App As Application
Private Sub App_WindowActivate(ByVal wb As Workbook, ByVal Wn As
Window)
Wn.Caption = wb.FullName
End Sub


Greg

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default Full path in taskbar

What do you mean by it doesn't work? The event will fire when you create
a new workbook.

If you mean you don't get the full path this is correct behaviour - the
workbook is not saved and therefore doesn't have a full path.

HTH,
Gareth

GregR wrote:
I have added a Class to my personal.xls which shows the full path of
the workbook in the caption. It all works except when I open a new
workbook. Is there something I am missing? Code below. TIA

Option Explicit
Public WithEvents App As Application
Private Sub App_WindowActivate(ByVal wb As Workbook, ByVal Wn As
Window)
Wn.Caption = wb.FullName
End Sub


Greg

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 246
Default Full path in taskbar

Gareth, you're right I don't get the full path, but I have save the WB,
even closed it and reopened it, still no full path.

Greg

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default Full path in taskbar

Hi Greg,

it works for me i.e. I don't need to close the workbook. Just toggle
between two workbooks and it updates.

I'd try checking your event is still firing - maybe you were tinkering
and crashed out of your code, that's normally enough to stop your app
level events firing.

If not that, maybe something is interfering with it? I'm using XL2003
SP1 btw.

Gareth

GregR wrote:
Gareth, you're right I don't get the full path, but I have save the WB,
even closed it and reopened it, still no full path.

Greg

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default Full path in taskbar

Greg,

GregR wrote:
Gareth, you're right I don't get the full path, but I have save the
WB, even closed it and reopened it, still no full path.


This should definitely work. When you open a new workbook, you won't see
the full path, as the file has not been saved. Even after you save the
workbook, you won't see the path because the WindowActivate event doesn't
fire. But when you reopen the saved workbook, you should see the full path
in the window's titlebar.

How are you instantiating your object and setting the application reference?
Something like this in a standard module?

Dim c As Class1

Sub start()
Set c = New Class1
Set c.App = Application
End Sub

Sub stopit()
Set c.App = Nothing
Set c = Nothing
End Sub

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 246
Default Full path in taskbar

Jake and Gareth, using Excel 2000 and instantiating the class with this
code in "ThisWorkbook"

Option Explicit
Dim AppClass As New ClsAppEvents
Private Sub Workbook_Open()

Set AppClass.App = Application
End Sub

It fires OK, if I close and reopen Excel

Greg

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default Full path in taskbar

Strange - sounds like it should work to me.

I remain convinced (probably wrongly) that this is an event firing issue
i.e. your AppClass becomes uninstantiated for some reason - maybe an
unhandled error in another App. Try this:

Place a line:

Msgbox "Bing!"

in your WithEvents sub. It will obviously fire every time you change to
a different workbook.

When you create a new workbook - does it still fire?

What about going to an existing workbook?

What service pack / release are you running?

G

GregR wrote:
Jake and Gareth, using Excel 2000 and instantiating the class with this
code in "ThisWorkbook"

Option Explicit
Dim AppClass As New ClsAppEvents
Private Sub Workbook_Open()

Set AppClass.App = Application
End Sub

It fires OK, if I close and reopen Excel

Greg

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 246
Default Full path in taskbar

Gareth, I added the class to my Book.xlt as well and all works just
fine now. Thank you very much for your input and patience.

Greg

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default Full path in taskbar

You're welcome. Glad you got it worked out.

GregR wrote:
Gareth, I added the class to my Book.xlt as well and all works just
fine now. Thank you very much for your input and patience.

Greg

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
Full path-name in title bar ? Stefan Excel Discussion (Misc queries) 14 January 13th 10 11:00 AM
Insert Full Path Roxy Excel Worksheet Functions 4 May 4th 07 09:31 PM
Full path possible to be seen? Octavio New Users to Excel 10 July 2nd 06 08:51 PM
Full path in title bar ntoze Excel Discussion (Misc queries) 0 February 21st 06 07:26 PM
Syntax for using the full path to get a value Tommy Flynn[_2_] Excel Programming 4 November 17th 03 07:15 PM


All times are GMT +1. The time now is 04:03 AM.

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"