Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
Hi, i use this code to send all data in a msflexgrid to an excel worksheet:
Private Sub cmdExcel_Click() Dim AppEx As Excel.Application Dim AreaLibroex As Excel.Workbook Dim AreaHojaEx As Excel.Worksheet Dim I As Integer, J As Integer 'Darle valores a los objetos excel Set AppEx = CreateObject("excel.application") Set AreaLibroex = AppEx.Workbooks.Add Set AreaHojaEx = AreaLibroex.Worksheets(1) 'Recorrer el grid y pasar los valores a cada celda de la hoja de excel prgBar.Max = grid.Rows - 1 For I = 0 To grid.Rows - 1 prgBar.Value = I For J = 0 To grid.Cols - 1 AreaHojaEx.Cells(I + 1, J + 1) = grid.TextMatrix(I, J) Next Next prgBar.Value = 0 prgBar.Max = 100 AppEx.Visible = True Set AppEx = Nothing Set AreaLibroex = Nothing Set AreaHojaEx = Nothing End Sub but, my throuble comes when one of the celd in the grid is a date, the convertion is bad. For example, if the celd says "01/12/04", in excel it appears like "12/01/04", the werid thing is that, that only happens with dates where month day. I use the "dd/mm/yy" format. it works like this: msflexgrid - excel 01/12/04 - 12/01/04 02/12/04 - 12/02/04 03/12/04 - 12/03/04 .... 11/12/04 - 12/11/04 12/12/04 - 12/12/04 13/12/04 - 13/12/04 this is true for all months. I tried a lot of things but nothing seems to work... please please please help me!! Sorry if my english is not so good, Matias. |
#2
![]() |
|||
|
|||
![]()
Try going into windows Control Panel, date and time and set the short date
to "dd/mm/yy" HTH Ken |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel version identification from Visual Basic | Excel Discussion (Misc queries) | |||
Formula in Visual Basic For Excel | Excel Discussion (Misc queries) | |||
Visual Basic Code Remains in "memory" | Excel Worksheet Functions | |||
Visual Basic Help | Excel Discussion (Misc queries) | |||
HOW CAN I GET OFFICE 2003 EXCEL BASIC TO NEST FUNCTIONS LIKE EXCE. | Excel Worksheet Functions |