Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to hide .CSV file extension ?
Hello @ll,
I have a macro that saves ".xls" as ".csv" but how can I hide th ".csv" extension (and use for example an extension ".100", and no ".100.csv") regards, Ayat -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to hide .CSV file extension ?
Get the macro to rename the file after it has been saved.
"Ayato " wrote in message ... Hello @ll, I have a macro that saves ".xls" as ".csv" but how can I hide the ".csv" extension (and use for example an extension ".100", and not ".100.csv") regards, Ayato --- Message posted from http://www.ExcelForum.com/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to hide .CSV file extension ?
The following should help. Please note that the file needs to be closed
Dim oldName As String Dim newName As String oldName = "c:\temp\book2.csv" newName = "c:\temp\book2.100" Name oldFile As newFile Bob Flanagan Macro Systems http://www.add-ins.com Productivity add-ins and downloadable books on VB macros for Excel "Ayato " wrote in message ... Hello @ll, I have a macro that saves ".xls" as ".csv" but how can I hide the ".csv" extension (and use for example an extension ".100", and not ".100.csv") regards, Ayato --- Message posted from http://www.ExcelForum.com/ |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to hide .CSV file extension ?
In Windows Explorer, click Tools | Folder Options + View tab and check the 'Hide file extensions for known file types' radio button. If you want this to apply to the whole filing system, clicke the 'Like Current Folder' button also.
|
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to hide .CSV file extension ?
Does this do what you want?
Workbooks("theworkbooknamehere").SaveAs "thefilename.100", xlCSV Troy "Ayato " wrote in message ... Hello @ll, I have a macro that saves ".xls" as ".csv" but how can I hide the ".csv" extension (and use for example an extension ".100", and not ".100.csv") regards, Ayato --- Message posted from http://www.ExcelForum.com/ |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to hide .CSV file extension ?
TroyW wrote:
*Does this do what you want? Workbooks("theworkbooknamehere").SaveAs "thefilename.100", xlCSV Troy "Ayato " wrote in message ... Hello @ll, I have a macro that saves ".xls" as ".csv" but how can I hide the ".csv" extension (and use for example an extension ".100", and not ".100.csv") regards, Ayato --- Message posted from http://www.ExcelForum.com/ * Hi Troy, This is what I am using.. -- Message posted from http://www.ExcelForum.com |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to hide .CSV file extension ?
This is code I use :
'save as Agent Report ActiveWorkbook.SaveA Filename:="C:\Reporting\Apple\Agent\24nl_agent." + savedate + "", _ FileFormat:=xlCSV, CreateBackup:=False ActiveWorkbook.Close SaveChanges:=Fals -- Message posted from http://www.ExcelForum.com |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to hide .CSV file extension ?
Bob Flanagan wrote:
*The following should help. Please note that the file needs to b closed Dim oldName As String Dim newName As String oldName = "c:\temp\book2.csv" newName = "c:\temp\book2.100" Name oldFile As newFile Bob Flanagan Macro Systems http://www.add-ins.com Productivity add-ins and downloadable books on VB macros for Excel "Ayato " wrote in message ... Hello @ll, I have a macro that saves ".xls" as ".csv" but how can I hide the ".csv" extension (and use for example an extension ".100", and not ".100.csv") regards, Ayato --- Message posted from http://www.ExcelForum.com/ * Mmmm does not work as I have a variable in the name.. -- Message posted from http://www.ExcelForum.com |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to hide .CSV file extension ?
I can't reproduce the behavior that you are reporting. In my testing from
VBA: ----- VBA Programming Interface: ActiveWorkbook.SaveAs "Test.100", xlCSV results in a file with the name of: Test.100 ActiveWorkbook.SaveAs "Test.csv", xlCSV results in a file with the name of: Test.csv ActiveWorkbook.SaveAs "Test", xlCSV results in a file with the name of: Test.csv ActiveWorkbook.SaveAs "Test.100.csv", xlCSV results in a file with the name of: Test.100.csv ----- Excel User Interface: If you save the file from the Excel user interface via the "File SaveAs" dialog box and you type in: "Test.100" (i.e. including the double quotes!!!!) and select "CSV (Comma delimited)(*.csv)" as the file format, then Excel will save the file with the name: Test.100 If you save the file from the Excel user interface via the "File SaveAs" dialog box and you type in: Test.100 (i.e. No double quotes!!!!) and select "CSV (Comma delimited)(*.csv)" as the file format, then Excel will save the file with the name: Test.100.csv FYI: I have "Hide extensions for known file types" unchecked in my Folder Options View. Troy "Ayato " wrote in message ... This is code I use : 'save as Agent Report ActiveWorkbook.SaveAs Filename:="C:\Reporting\Apple\Agent\24nl_agent." + savedate + "", _ FileFormat:=xlCSV, CreateBackup:=False ActiveWorkbook.Close SaveChanges:=False --- Message posted from http://www.ExcelForum.com/ |
#10
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to hide .CSV file extension ?
Can't you make the code remember the variable?
oldname = PathName & "\" & FileName & ".csv" etc. - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions http://PeltierTech.com/ _______ Ayato < wrote: Bob Flanagan wrote: *The following should help. Please note that the file needs to be closed Dim oldName As String Dim newName As String oldName = "c:\temp\book2.csv" newName = "c:\temp\book2.100" Name oldFile As newFile Bob Flanagan Macro Systems http://www.add-ins.com Productivity add-ins and downloadable books on VB macros for Excel "Ayato " wrote in message ... Hello @ll, I have a macro that saves ".xls" as ".csv" but how can I hide the ".csv" extension (and use for example an extension ".100", and not ".100.csv") regards, Ayato --- Message posted from http://www.ExcelForum.com/ * Mmmm does not work as I have a variable in the name... --- Message posted from http://www.ExcelForum.com/ |
#11
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to hide .CSV file extension ?
Bad idea. This might hide an extension of a virus. If its name is
MyFile.xls.exe, it only looks like MyFile.xls, so you try opening the workbook and instead launch a virus. - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions http://PeltierTech.com/ _______ AA2e72E wrote: In Windows Explorer, click Tools | Folder Options + View tab and check the 'Hide file extensions for known file types' radio button. If you want this to apply to the whole filing system, clicke the 'Like Current Folder' button also. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Display file name without the file type extension | Excel Worksheet Functions | |||
Determine Excel file version with no file extension. | Excel Discussion (Misc queries) | |||
file format or file extension is not valid...error message | Excel Discussion (Misc queries) | |||
Additional file with no extension created during File Save As proc | Excel Discussion (Misc queries) | |||
I need to download an exel spreadsheet file. (file extension :xls) | Excel Discussion (Misc queries) |