軟件bug,軟件緩存過(guò)多。
企業(yè)建站必須是能夠以充分展現(xiàn)企業(yè)形象為主要目的,是企業(yè)文化與產(chǎn)品對(duì)外擴(kuò)展宣傳的重要窗口,一個(gè)合格的網(wǎng)站不僅僅能為公司帶來(lái)巨大的互聯(lián)網(wǎng)上的收集和信息發(fā)布平臺(tái),成都創(chuàng)新互聯(lián)公司面向各種領(lǐng)域:石涼亭等成都網(wǎng)站設(shè)計(jì)、營(yíng)銷型網(wǎng)站解決方案、網(wǎng)站設(shè)計(jì)等建站排名服務(wù)。
1、vb.netgrid軟件運(yùn)行服務(wù)器出現(xiàn)bug導(dǎo)致自動(dòng)生成excel不保存,退出重新進(jìn)入,等待官方修復(fù)。
2、vb.netgrid軟件緩存過(guò)多導(dǎo)致自動(dòng)生成excel不保存,清理軟件空間,重啟軟件。
這里有段VB6.0的,你可以參考。
注意添加引用。
Private Sub Command6_Click()
Dim i, j As Integer
Dim xlApplication As Excel.Application, xlWorkbook As Excel.Workbook, xlSheet
Dim xlApp As Excel.Application
On Error Resume Next
Set xlApplication = GetObject(, "Excel.Application")
Set xlApp = CreateObject("Excel.Application")
If MsgBox("確認(rèn)將文件信息導(dǎo)出到EXCEL中??", vbExclamation + vbYesNo, "警告") = vbYes Then
If Err.Number 0 Then Set xlApplication = CreateObject("Excel.Application")
Set xlWorkbook = xlApplication.Workbooks.Add
Set xlSheet = xlWorkbook.ActiveSheet
xlSheet.Cells(1, 2) = lblcl.Caption
xlSheet.Range("A1:E1").MergeCells = True
xlSheet.Range("A1:E1").HorizontalAlignment = xlCenter
xlSheet.Cells(2, 2).ColumnWidth = 18
For i = 1 To DataGrid1.Columns.Count
xlSheet.Cells(2, 1) = "編號(hào)"
xlSheet.Cells(2, i + 1) = DataGrid1.Columns(i).Caption
For j = 0 To DataGrid1.VisibleRows - 1
xlSheet.Cells(j + 3, 1) = j + 1
xlSheet.Cells(j + 3, i + 1) = DataGrid1.Columns(i).CellText(DataGrid1.RowBookmark(j))
Next j
Next i
xlApplication.Visible = True
Set xlSheet = Nothing
Set xlWorkbook = Nothing
Set xlApplication = Nothing
'xlApp.Range("A2:L2").Columns.Interior.ColorIndex = 40
'xlApp.Range("A2:L2").Borders.LineStyle = xlContinuous
'xlApp.Visible = True
'xlApp.Range(xlSheet.Cells(2 + PartsRs.RecordCount + 1, 1), xlSheet.Cells(2 + PartsRs.RecordCount + 1, 8)).Columns.Interior.ColorIndex = 40
'xlApp.Range(xlSheet.Cells(2 + PartsRs.RecordCount + 1, 1), xlSheet.Cells(2 + PartsRs.RecordCount + 1, 8)).Borders.LineStyle = xlContinuous
Else
MsgBox "無(wú)信息可供您導(dǎo)出,請(qǐng)確認(rèn)!", vbExclamation + vbOKOnly, "警告"
End If
End Sub
項(xiàng)目——添加引用——com——microsoft excel 11.0 object library
Dim Xls As Excel.Application = New Excel.Application '定義excel應(yīng)用程序
Dim Xlsbook As Excel.Workbook '定義工作簿
Dim Xlssheet As Excel.Worksheet '定義工作表
Xls.Visible = True '顯示excel 程序
Xlsbook = Xls.Application.Workbooks.Add '添加新工作簿 或exbook=exapp.workbooks.open("路徑\文件名")'打開(kāi)已存在工作薄
Xlssheet = Xlsbook.Sheets(1) '第1個(gè)工作表的控制句柄
MsgBox("EXCEL檔案創(chuàng)建完畢!")
Xlssheet.Cells(1, 1) = "這是一個(gè)創(chuàng)建EXCEL的示例"
Dim Sdlg As SaveFileDialog = New SaveFileDialog '定義一個(gè)保存對(duì)話框
Sdlg.FileName = "*.xls" '保存對(duì)話框的默認(rèn)文件名
Sdlg.Filter = "EXCEL檔案(*.Xls)|*.Xls" '過(guò)濾器設(shè)置
If Sdlg.ShowDialog = Windows.Forms.DialogResult.OK Then '如果保存對(duì)話框的確認(rèn)按鈕被按下
Xlsbook.SaveAs(Sdlg.FileName) '保存文件
End If
Xlssheet = Nothing '釋放資源
Xlsbook.Close() '關(guān)閉工作簿
Xlsbook = Nothing '釋放資源
Xls.Quit() '退出excel應(yīng)用程序
Xls = Nothing