cetee
級(jí)別: 略有小成
![]() |
希望各位大俠幫幫忙。 vb如何把文本框中的數(shù)據(jù)保存到excel,不能覆蓋,而是能保存到下一行,不影響前幾行保存的數(shù)據(jù). |
---|---|
|
alian9631
電控編程\設(shè)計(jì)
級(jí)別: 略有小成
![]() |
這個(gè)不難呀,但一兩句話也說(shuō)不清楚! |
---|---|
|
cetee
級(jí)別: 略有小成
![]() |
各位樓主能發(fā)個(gè)列子嗎?這是小弟寫(xiě)的。但是 不 能操作。請(qǐng) 樓主指點(diǎn)。謝謝。。 Imports excel = Microsoft.Office.Interop.Excel Imports System.IO Public Class Form1 Private Sub Button1_Click(sender As Object, e As EventArgs) End Sub Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load End Sub Private Sub Button1_Click_1(sender As Object, e As EventArgs) Handles Button1.Click Dim fileTest As String = "c:\Temp\ExcelTest\test.xlsx" If File.Exists(fileTest) Then File.Delete(fileTest) End If Dim oexcel As Object oexcel = CreateObject("excel.Application") Dim obook As excel.Workbook Dim osheet As excel.Worksheet obook = oexcel.Workbooks.Add osheet = oexcel.Worksheets(1) osheet.Name = "test name" osheet.Range("1,1").Value = "button 1" obook.SaveAs(fileTest) obook.Close() obook = Nothing oexcel.Quit() oexcel = Nothing End Sub End Class |
---|---|
|
guolibin
auto_glb@qq.com
級(jí)別: VIP會(huì)員
![]() |
網(wǎng)上有VBA的例子 |
---|---|
|