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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code to save file differently?

Status
Not open for further replies.

NYFashionToGo

Technical User
Jan 16, 2007
76
US
I am pulling my hair out here trying to understand why something is happening.

I have some code that interacts between Excel and Access, It creates a csv file which then renamed to XML to push through my shipping service...

The whole time I work with it in excel. It appears fine. When I save it to CSV it adds quotes on me and throws off my finished xml... and it doesnt run......

Is there a way I can save it to csv or txt without the quotes. It is really bizzarre because i never ever see them until it is saved csv or txt.... I am trying to create a workaround... I tried formating cells differently, I tried exporting out of Access differently...... Every single time, It adds two quotes per cell. One in the beginning and one at the end of each cell contents... But I cant see it while excel is working, It is not there when working with the data.

Anyone have any helpful advice on a work around....

Thanks
 
You know, it would be helpfull if you would show the code where you create csv file, how you write data into it.

This way it would be easier to say where quotes come from.


Have fun.

---- Andy
 
I think you are correct.


Here is the code:

Sub MasterShippingLabel()
'
' MasterShippingLabel Macro
' Macro recorded 11/26/2006 by Chris Giroffi
'
' Keyboard Shortcut: Ctrl+Shift+S
'




Application.DisplayAlerts = False


Application.Run "'In A NY Minute Ship Labels.xls'!ShipDomesticImport"
Application.Run "'In A NY Minute Ship Labels.xls'!ShipDomesticSort"
Application.Run "'In A NY Minute Ship Labels.xls'!AirMailLetterOpening"
Application.Run "'In A NY Minute Ship Labels.xls'!AirMailSort"
Application.Run "'In A NY Minute Ship Labels.xls'!GlobalPriorityOpening"
Application.Run "'In A NY Minute Ship Labels.xls'!GlobalPrioritySort"




Sheets("DazzleAirmailLetter").Visible = True
Sheets("DazzleAirmailLetter").Select
ChDir _
"C:\Documents and Settings\Chris\My Documents\NYFashionToGo\ProcessingFiles\ShippingLabels"
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\Chris\My Documents\NYFashionToGo\ProcessingFiles\ShippingLabels\DazzleAirMailLetter.csv" _
, FileFormat:=xlCSV, CreateBackup:=False

Sheets("DazzleAirmailLetter").Visible = False



Sheets("DazzleDomestic").Visible = True
Sheets("DazzleDomestic").Select

ChDir _
"C:\Documents and Settings\Chris\My Documents\NYFashionToGo\ProcessingFiles\ShippingLabels"
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\Chris\My Documents\NYFashionToGo\ProcessingFiles\ShippingLabels\DazzleDomestic.csv" _
, FileFormat:=xlText, CreateBackup:=False







Sheets("DazzleGlobalPriority").Visible = True
Sheets("DazzleGlobalPriority").Select
ChDir _
"C:\Documents and Settings\Chris\My Documents\NYFashionToGo\ProcessingFiles\ShippingLabels"
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\Chris\My Documents\NYFashionToGo\ProcessingFiles\ShippingLabels\DazzleGlobalPriority.csv" _
, FileFormat:=xlCSV, CreateBackup:=False

Sheets("DazzleGlobalPriority").Visible = False













Sheets("DazzleDomestic").Visible = True
Sheets("DazzleDomestic").Select

ChDir _
"C:\Documents and Settings\Chris\My Documents\NYFashionToGo\ProcessingFiles\ShippingLabels"
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\Chris\My Documents\NYFashionToGo\ProcessingFiles\ShippingLabels\DazzleDomestic.csv" _
, FileFormat:=xlText, CreateBackup:=False






Sheets("GlobalPrioritySort").Visible = False
Sheets("GlobalPriority").Visible = False
Sheets("ShipDomesticSort").Visible = False
Sheets("ShipDomestic").Visible = False
Sheets("AirMailLetterSort").Visible = False
Sheets("AirMailLetter").Visible = False
Sheets("DazzleDomestic").Visible = False
Sheets("DazzleAirmailLetter").Visible = False





ChDir "C:\Documents and Settings\Chris\My Documents\NYFashionToGo\ExcelTools"
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\Chris\My Documents\NYFashionToGo\ExcelTools\In A NY Minute Ship Labels.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False




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"

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

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









End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top