程序为:
xlSheet.Cells(i, j) = SourceGrid.TextMatrix(i, j)
转移到excel后整张表黑底无字,而且只剩下两行两列
这个现象只存在一个窗体中(上面的所有msflexgrid都有这个问题),其他窗体用同样的代码正常BTW,用debug.print sourcegrid.cols,返回值为2,而实际上该MSflexgrid上有24列
xlSheet.Cells(i, j) = SourceGrid.TextMatrix(i, j)
转移到excel后整张表黑底无字,而且只剩下两行两列
这个现象只存在一个窗体中(上面的所有msflexgrid都有这个问题),其他窗体用同样的代码正常BTW,用debug.print sourcegrid.cols,返回值为2,而实际上该MSflexgrid上有24列
解决方案 »
- ActiveReport 如何重复2次打印同一内容
- DSOFramer的问题
- 在线等 同时判断2个文件,帮忙看下那里错了
- 一个好像很简单的access自动编号的问题,急需处理!
- 打开一个数据库文件之后,如何关闭?(附程序)
- *********将Excel数据导入Access时,怎么向表中追加数据,而不是自动新建一个表
- 大家帮帮忙!用vb怎么编写杨辉三角形?有急用啊!!!
- ado对象返回查询结果的问题?
- 请问:datareport使用产生“多步操作产生错误..”问题。谢谢大家了,我好急!
- 和我交朋友吧! (^_^)
- 如何把 工程 部件中的 ms windows common control 6 .0 sp4 换为ms windows common control -2 6.0 sp4
- 为什么最后一条记录无法修改呀??急啊~~555
至于导出成为excel,方法实在太多.最简单的就是记录集直接saveas.或者将网格内的
数据存为一个数组,将这个数组作为excel的数据源.一下就好了.
装了SP6,但没什么用'把窗体A中grdB(一个MSFlexGrid)导入到excel表(从excel表第五行开始)Public Sub GridToExl(SourceGrid As MSFlexGrid, StartRow As Long)
Dim i As Long, j As Long For i = 0 To SourceGrid.Rows - 1
For j = 0 To SourceGrid.Cols - 1
xlSheet.Cells(StartRow + i, 1 + j).Font.Name = "Verdana"
xlSheet.Cells(StartRow + i, 1 + j).Font.Size = 9
xlSheet.Cells(StartRow + i, 1 + j) = SourceGrid.TextMatrix(i, j)
SourceGrid.Row = i
SourceGrid.Col = j
If j = 0 Then xlSheet.Cells(StartRow + i, 1 + j).Interior.Color = RGB(180, 180, 180)
If i = 0 Then xlSheet.Cells(StartRow + i, 1 + j).Interior.Color = RGB(120, 120, 120)
If i <> 0 And j <> 0 Then xlSheet.Cells(StartRow + i, 1 + j).Interior.Color = SourceGrid.CellBackColor
xlSheet.Cells(StartRow + i, 1 + j).Font.Color = SourceGrid.CellForeColor
xlSheet.Cells(StartRow + i, 1 + j).Font.Bold = SourceGrid.CellFontBold
xlSheet.Cells(StartRow + i, 1 + j).Font.Italic = SourceGrid.CellFontItalic
Next j
Next iEnd Sub后来我新建了一窗体,重新建立所有控件,但问题还是不成To xghim:
该窗体和网格的属性和其他的差不多,没看出什么异样