View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Yuvraj Yuvraj is offline
external usenet poster
 
Posts: 27
Default Problem in the data of the file in the FTP after the saving of excelsheets

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