Hello everybody,
In my small program, I'm exporting data from a MSFlexgrid to Excel.
But in column J - K - L and M, instead of exporting the number in the real format like that for example: "200908250700" it writes: 2.01E+11.HTML Code:Private Sub Command7_Click() Dim xlObject As Excel.Application Dim xlWB As Excel.Workbook Set xlObject = New Excel.Application 'This Adds a new woorkbook, you could open the workbook from file also Set xlWB = xlObject.Workbooks.Add Clipboard.Clear 'Clear the Clipboard With MSFlexGrid1 'Select Full Contents (You could also select partial content) .Col = 0 'From first column .Row = 0 'From first Row (header) .ColSel = .Cols - 1 'Select all columns .RowSel = .Rows - 1 'Select all rows Clipboard.SetText .Clip 'Send to Clipboard End With With xlObject.ActiveWorkbook.ActiveSheet .Range("A1").Select 'Select Cell A1 (will paste from here, to different cells) .Paste 'Paste clipboard contents End With ' This makes Excel visible xlObject.Visible = True MsgBox "File Creation Complete" End Sub
What can I do to prevent that?
Thanks for your help.




Reply With Quote