Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
removing the file extention
Is there an easy way of removing the file extention from the file name?
|
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
removing the file extention
If the filename also has its path with it...
FileNameOnly = Mid(Left(PathAndFilename, InStrRev(PathAndFilename, _ ".") - 1), InStrRev(PathAndFilename, "\") + 1) If the filename is by itself (that is, without its path)... FileNameOnly = Left(FilenameAndExtension, _ InStrRev(PathAndFilename, ".") - 1) -- Rick (MVP - Excel) "Fan924" wrote in message ... Is there an easy way of removing the file extention from the file name? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
removing the file extention
On 9 Dec, 14:31, Fan924 wrote:
Is there an easy way of removing the file extention from the file name? Hi Fan Sub StripExt() Dim str_FileName As String str_FileName = Left(ActiveWorkbook.Name, Len(ActiveWorkbook.Name) - 4) End Sub Regards Steve |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
removing the file extention
Your statement may not work for the OP... file extensions are not always only three characters long. Some examples from the Office 12 (Office 2007) directory... ExpenseReport.xltx, excel.exe.manifest, SOLVER.XLAM, Building Blocks.dotx, NewFileItems.vsdir, etc. -- Rick (MVP - Excel) "Scoops" wrote in message ... On 9 Dec, 14:31, Fan924 wrote: Is there an easy way of removing the file extention from the file name? Hi Fan Sub StripExt() Dim str_FileName As String str_FileName = Left(ActiveWorkbook.Name, Len(ActiveWorkbook.Name) - 4) End Sub Regards Steve |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel XLW file extention | Excel Discussion (Misc queries) | |||
How can I turn on or off for backup file with XLK extention? | Excel Discussion (Misc queries) | |||
file extention .xsls | Setting up and Configuration of Excel | |||
changing file extention names | Excel Discussion (Misc queries) | |||
Problem w/ open no extention file | Excel Programming |