Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error with currunc
Hi.
I´ve made a simple macro to save 2 sheets do a txt tab separated. The problem is that the numbers formated as "currency" (with a euro sign) end up with a dollar sign in the resulting txt. Does anyone knows why this is hapenning? this is my code Sheets("HOLDI").Select ActiveWorkbook.SaveAs Filename:= _ ActiveWorkbook.Path & "\..\Dados_holdi.txt" _ , FileFormat:=xlText, CreateBackup:=False Sheets("EMP").Select ActiveWorkbook.SaveAs Filename:= _ ActiveWorkbook.Path & "\Dados_emp.txt" _ , FileFormat:=xlText, CreateBackup:=False ActiveWindow.Close Thnks a lot SpeeD |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error with currunc
Had the same problem myself - it's because it's an American package and
defaults to American formats (same problem with dates which are even more of a headache!). Sorry, haven't found a solution but would love to hear of one - hence tagging on to this thread. "SpeeD72" wrote: Hi. I´ve made a simple macro to save 2 sheets do a txt tab separated. The problem is that the numbers formated as "currency" (with a euro sign) end up with a dollar sign in the resulting txt. Does anyone knows why this is hapenning? this is my code Sheets("HOLDI").Select ActiveWorkbook.SaveAs Filename:= _ ActiveWorkbook.Path & "\..\Dados_holdi.txt" _ , FileFormat:=xlText, CreateBackup:=False Sheets("EMP").Select ActiveWorkbook.SaveAs Filename:= _ ActiveWorkbook.Path & "\Dados_emp.txt" _ , FileFormat:=xlText, CreateBackup:=False ActiveWindow.Close Thnks a lot SpeeD |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error with currunc
Hi.
It´s a really bad situation. It would save me a ton of time if we could make this work... Microsoft... is there anybody out there? SpeeD |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error with currunc
try this code. I modified one of my CSV wriote programs to put TAB instead
of Comma. Sub WriteTAB() Const Delimiter = chr(9) Const ForReading = 1, ForWriting = 2, ForAppending = 3 Const MyPath = "C:\temp\" Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0 Set fswrite = CreateObject("Scripting.FileSystemObject") WriteFileName = "text.csv" 'open files WritePathName = MyPath + WriteFileName fswrite.CreateTextFile WritePathName Set fwrite = fswrite.GetFile(WritePathName) Set tswrite = fwrite.OpenAsTextStream(ForWriting, TristateUseDefault) lastrow = Cells(Rows.Count, "A").End(xlUp).Row For RowCount = 1 To lastrow LastCol = Cells(RowCount, Columns.Count).End(xlToLeft).Column For ColCount = 1 To LastCol If ColCount = 1 Then OutputLine = Cells(RowCount, ColCount) Else OutputLine = OutputLine & Delimiter & Cells(RowCount, ColCount) End If Next ColCount tswrite.writeline OutputLine Next RowCount tswrite.Close Exit Sub End Sub "SpeeD72" wrote: Hi. It´s a really bad situation. It would save me a ton of time if we could make this work... Microsoft... is there anybody out there? SpeeD |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
run time error 1004 general odbc error excel 2003 vba | Excel Programming | |||
Error Handling - On Error GoTo doesn't trap error successfully | Excel Programming | |||
Form Err.Raise error not trapped by entry procedure error handler | Excel Programming | |||
Automation Error, Unknown Error. Error value - 440 | Excel Programming |