Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A way to name ...What a File will be named based on a spreadsheet

Status
Not open for further replies.

NewYorkFashionToGo

Programmer
Oct 20, 2006
44
US
hello and thanks for looking at this post, I have a question about some VBA programing in Excel. I have some VBA and VB scripts that change the Name of the file that just was created... I would like to take this one step further. Is there a way I can Name a file or choose NOT to name a file based on the results of a spreadsheet. For example in the case I want to use it in, I am changing the format of a file from .csv to .xml, If there are no results on the csv I do not want to change the file to xml because there is no data there.


If DazzleDomestic.csv cell a1 =""(Nothing, Then leave File name as DazzleDomestic.csv .......If not then DazzleDomestic.XML


the Actual Function I have right now is:

Name "C:\Documents and Settings\Chris\My Documents\NYFashionToGo\ProcessingFiles\ShippingLabels\DazzleDomestic.csv" As "C:\Documents and Settings\Chris\My Documents\NYFashionToGo\ProcessingFiles\ShippingLabels\DazzleDomestic.xml"



Any help would be greatly appreciated thank you so much>>>>>>>
 

So, you do have the csv file opened. Well do the check and use the Workbook SaveAs method to save it as xml and then close it, or just close it without saving!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top