Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default 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
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
run time error 1004 general odbc error excel 2003 vba Mentos Excel Programming 5 January 24th 11 02:56 PM
Error Handling - On Error GoTo doesn't trap error successfully David Excel Programming 9 February 16th 06 05:59 PM
Form Err.Raise error not trapped by entry procedure error handler [email protected] Excel Programming 1 February 8th 06 10:19 AM
Automation Error, Unknown Error. Error value - 440 Neo[_2_] Excel Programming 0 May 29th 04 05:26 AM


All times are GMT +1. The time now is 04:07 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"