zero's in excel cell getting rounded off

  • Thread starter Thread starter Nasreen naqvi
  • Start date Start date
N

Nasreen naqvi

i am using a VB routine to parse the text file and copy the data to an
excel sheet.and if in text file the data is 000000000 it is getting
rounded to just one 0 and i need all of them in excel, any thoughts?

Private Sub cmdgo_Click()
Set sap_xlapp = CreateObject("Excel.Application") 'New
Excel.Application
sap_xlapp.DisplayAlerts = False
sap_xlapp.Workbooks.Open App.Path & "\SAP_Data.xls", , False, , , ,
True, , , True, False 'the excel file is now opened
sap_xlapp.Worksheets(1).Activate ' the excel worksheet is now active
for reading
Set sap_xlws = sap_xlapp.ActiveSheet
l_int_srow = 1

sap_xlws.Cells(l_int_srow, 1) = "Permanent Number"
sap_xlws.Cells(l_int_srow, 2) = "Name"
l_int_srow = l_int_srow + 1
cmdgo.Enabled = False
Call Main

'Transformation completed so clean up resources
cmdgo.Enabled = True
Set sap_xlws = Nothing
sap_xlapp.ActiveWorkbook.Save
sap_xlapp.ActiveWorkbook.Close
sap_xlapp.Quit
Set sap_xlapp = Nothing

End Sub

as seen in the code the numberic value is getting off which is stored in
variable of string type
 
There is nothing in the code you show that would do this. There is nothing
in the code you show that would be considered as parsing a text file.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top