I'm opening a .csv file, copying the contents, then pasting into an Excel .xlsb worksheet.
In the .xlsb file, I've preformatted column A for text using the "@" option.
The first column in the .csv file is text with entries like "004", 008", "012", etc.
When I paste the .csv contents into the .xlsb worksheet, the leading zeros are stripped off. The column still stills shows as Text formatted and the data are left registered as text would be.
For copy, I'm using:
crng = xl.Range(xl.Cells(2, 1), xl.Cells(chlrow, chlcol))
crng.Copy()
For paste, I'm using:
prng = xl.Range(xl.Cells(plrow + 3, 1), xl.Cells(plrow + 3, 1))
prng.PasteSpecial(XlPasteType.xlPasteValues, XlPasteSpecialOperation.xlPasteSpecialOperationNone, False, False)
I thought "PasteValues" would transfer the data without modification but apparently I thought wrongly.
Any suggestions,
thanks