Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 340
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 115
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 115
Default 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
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
Display file name without the file type extension NAHolmes Excel Worksheet Functions 5 November 23rd 09 05:54 PM
Determine Excel file version with no file extension. tjlumpkin Excel Discussion (Misc queries) 2 July 23rd 09 06:59 AM
file format or file extension is not valid...error message Ballun Excel Discussion (Misc queries) 0 May 7th 09 09:06 PM
Additional file with no extension created during File Save As proc Peter Rooney Excel Discussion (Misc queries) 2 August 11th 05 02:48 PM
I need to download an exel spreadsheet file. (file extension :xls) buckrogers Excel Discussion (Misc queries) 2 December 8th 04 11:08 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"