ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how to hide .CSV file extension ? (https://www.excelbanter.com/excel-programming/300424-how-hide-csv-file-extension.html)

Ayato[_4_]

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


Stephen Bye[_3_]

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/




Bob Flanagan

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/




AA2e72E[_2_]

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.

TroyW[_2_]

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/




Ayato[_5_]

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


Ayato[_6_]

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


Ayato[_7_]

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


TroyW[_2_]

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/




Jon Peltier[_7_]

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/



Jon Peltier[_7_]

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.




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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com