View Single Post
  #7   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 ex

On 10 June, 15:00, Dave Peterson wrote:
So what do you see in the formula bar? *Or after you've changed the number
format to General?

Saved from a previous post.

It could mean a few things.

1. *The columnwidth is too narrow to show the number.

* * Widen the column or change the font size of that cell. *Or change the
* * numberformat to General.

2. *You have a date/time in that cell and it's negative

* * Don't use negative dates. *If excel was helping you, it may have
* * changed the format to a date. *Change it back to General (or some
* * other number format).

* * If you need to see negative date/times:
* * Tools|options|Calculation Tab|and check 1904 date system
* * (but this can cause trouble--watch what happens to your dates
* * and watch what happens when you copy|paste dates to a different
* * workbook that doesn't use this setting)

3. *You have a lot of text in the cell, the cell is formatted as Text.

* * Format the cell as general.

4. *You really have ###'s in that cell.

* * Clean up that cell.

5. *You have # in a cell, but it's format is set to Fill.

* * Change the format
* * (format|cells|alignment tab|horizontal box, change it to General.





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


--

Dave Peterson- Hide quoted text -

- Show quoted text -


Thank you Dave for your reply.

Dave ideally the code opens up abcd.xls file and then copies the
Sheet1, Sheet2 of abcd.xls to the application excel file ideally
app.xls and then the code does workbook.save which saves the app.xls
so when the application opens it should show the changed data.

The problem caused is the abcd.xls Sheet2 data which is in general
format, ideally processed by the Scheduler.

The application when it copies the abcd.xls Sheet1 data to app.xls
Sheet1 it shows the correct Date with the format as General, but when
it is saved in the File Server, it shows the format changed to Date.

So as that was a general format, and when automatically gets converted
to Date format shows ####.

This happend on workbook.save function which ideally saves app.xls and
loads it to FTP so the application again opens it from FTP next time
app.xls.

The points mentioned by you is very significant.

I want to know that the app.xls has Sheet1 and Sheet2.

Ideally Sheet1 copies abcd.xls Sheet1 data which is in general format,
but after workbook.save that abcd.xls Sheet1 data which is in general
format gets changed to date format on app.xls after workbook.save.

Sheet1 data of abcd.xls was processed by the Scheduler and was pasted
there. Ideally the file processed by the scheduler was a csv which
after processing was pasted to an excel file abcd.xls.

Ideally when we open abcd.xls Sheet1 in independant mode it shows
General format for Sheet1 but when it is copied to app.xls via
application and saved by workbook.save function whicg ideally saves
app.xls the Sheet1 in app.xls changed to date format from general
format hence shows ####.

Why this conversion on its own Dave.

Please help and do ask me if you all need any information.

Regards,

Yuvraj