Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
TWIMC,
When my Auto_Open() kicks off I need to be able to establish the file name. The reason for this is that when I'm designing my Excel Add in my file name uses the .xls extension so i refer to my file as FileName.xls but when I want to save my file as an Excel Add-in, the file extension changes to .xla, thus I need to update my reference in the code. Therefore it would good if I can obtain the file name when the Auto_Open() starts, then I don't have to manualy change the reference. Any ideas on how to accomplish this would be create. TIA KM |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
thisworkbook.Path
Thisworkbook.Fullname Thisworkbook.Name -- Regards, Tom Ogilvy "Kevin McCartney" wrote in message ... TWIMC, When my Auto_Open() kicks off I need to be able to establish the file name. The reason for this is that when I'm designing my Excel Add in my file name uses the .xls extension so i refer to my file as FileName.xls but when I want to save my file as an Excel Add-in, the file extension changes to .xla, thus I need to update my reference in the code. Therefore it would good if I can obtain the file name when the Auto_Open() starts, then I don't have to manualy change the reference. Any ideas on how to accomplish this would be create. TIA KM |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Tom,
How can we return a workbook's file name with and without extension? Thanks in advance. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is this what you want?
With Extension: ============================= ThisWorkbook.Name Without Extension ============================= Left(ThisWorkbook.Name, InStrRev(ThisWorkbook.Name, ".") - 1) -- Rick (MVP - Excel) "ch" wrote in message ... Hi Tom, How can we return a workbook's file name with and without extension? Thanks in advance. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
you can use ThisWorkbook.FullName ThisWorkbook.Name thisworkbook.Path eg: Dim wkb as Workbook Set Wkb = ThisWorkbook msgbox wkb.fullname -- Regards, Sébastien <http://www.ondemandanalysis.com "Kevin McCartney" wrote: TWIMC, When my Auto_Open() kicks off I need to be able to establish the file name. The reason for this is that when I'm designing my Excel Add in my file name uses the .xls extension so i refer to my file as FileName.xls but when I want to save my file as an Excel Add-in, the file extension changes to .xla, thus I need to update my reference in the code. Therefore it would good if I can obtain the file name when the Auto_Open() starts, then I don't have to manualy change the reference. Any ideas on how to accomplish this would be create. TIA KM |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
code in module A to not execute a Worksheet_SelectionChange sub of another module | Excel Discussion (Misc queries) | |||
Run worksheet module code from workbook module? | Excel Programming | |||
Calls from sheet module to ThisWorkbook module | Excel Programming | |||
Check if filename exists. | Excel Programming | |||
Variable from a sheet module in a class module in XL XP | Excel Programming |