View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Problem in the data of the file in the FTP after the saving of

I can't tell from the code if this is an XLS file or CSV. I suspecting it is
CSV which is really a text file with field seperated by commas. I was
assuming it was XLS. Below are my comments if the file is CSV. XLS should
not cause the problems you are seeing.

Normally when you transfer CSV data from one software package to another
software package you add delimiates like double quote to provent accidental
conversion. Excel is performing automatic translation on number that it
thinks is dates when it shouldn't.

I don't know if the problem is with saving or reading the CSV data. You
need to open the CSV file with Notepad to determine if the problem is with
the saving or reading. I can write a macro which will save the spreadsheet
data and put double quotes around each field or single quotes.

Let me know if you need additional help.

"Yuvraj" wrote:

On 10 June, 11:29, Joel wrote:
The #### are only due to the column width being too narrow. Just increase
the widtrth of the columns and everything will be ok.

You don't have to zip the excel file if you FTP using binary mode instead of
text mode unless there is a firewall that is blocking XLS files.



"Yuvraj" wrote:
Hi All,


I am facing a strange problem in the save code.


The details are as follows:


Public Function SaveData() As Boolean
For intcount = 1 To intMgrCount + 1
strSheetName = ThisWorkbook.Worksheets("A").Range("P3").Offset
(intcount - 1, 0).Value
Set mwksDataStore = mwbDataStore.Worksheets(strSheetName)
Set rngTgt = mwksDataStore.UsedRange
rngTgt.ClearContents
Set rngTgt = mwksDataStore.Range("A2")
Set rngSrc = ThisWorkbook.Worksheets(strSheetName)..UsedRange
Set rngTgt = rngTgt.Resize(rngSrc.Rows.Count,
rngSrc.Columns.Count)
rngTgt.Value = rngSrc.Value
Next intcount


fMsg.msg = "Uploading data. Please wait..."


saveData = saveSPTes()


End Function


//The Problem lies here
Explanation: The application gets the file from the FTP and saves it
in Temp folder and then opens the application using that data.


When I save the application workbook which is ideally the abcd.xls in
the Temp folder using


mwbDataStore.save
mwbDataStore.Close
these two lines of code it saves the abcd.xls in the Temp folder and
then using upload function i zip it back to 8657.zip in the FTP.


I do not know that some of the sheets which it saves say sheet1 in
8657.zip


have data
#### a b c d
09/06/09 e f g h
09/06/09 i j k l


I am not understanding while saving the data it showed 09/06/09 in
case of ####, but when i open the file which it ha put back to server,
the 09/06/09 for first line is changed to #### though i am just using
"mwbDataStore.save" which just saves the workbook as it is.


Why it happens only for the first line and also it says if you put the
cursor on #### that negative dates are not allowed, but ideally before
i save the workbook i saw that the dates were not negative. It is same
as the other rows, Is that some thing to do with the excel properties
what negative as everything is same as other rows.


Private Function saveSPTes() As Boolean
strXLS$ = mwbDataStore.FullName
strZIP$ =8657
mwbDataStore.save
mwbDataStore.Close
Set mwbDataStore = Nothing


With myFtp
.Connect
saveSP = .upload(tempDir() & strZIP$, FTP_DATA_PATH & strZIP$)
End With
End Function


Please help guys.


I am a bit perturbed with this strange behavious of the
mwbDataStore.save


Regards,


Yuvaraj- Hide quoted text -


- Show quoted text -


Thanx Joe for the reply, but the issue is different.

I am not worried if the #### is having the date which can be seen by
increasing the length of the row.

Ideally the #### i am talking does not contain any date it is just
############ till infinite and does not have any value.

The reason why it is happening is because if you right click on that
cell and see the format then the format of that has been changed from
general to date which is ##########.

For the other cells that format is general hence it displays as date
ideally,09/06/09.
I am woried because that is not something whichi is done by the code,
then why while saving it is changing the format of the cell from
general to date format which gives the value as #### and that is also
happening for only one cell.

Regards,

Yuvraj