开发者

Writing values to already existing worksheet

I already have an Excel worksheet. How do开发者_如何转开发 I write some values to that worksheet from my VB application?


Note: This is an Excel-VBA solution; however, someone has changed the question tag to VB.NET since.

Sub MySub()
    Set xlApp = CreateObject("Excel.application")
    xlApp.Visible = True
    Set xlBook = xlApp.Workbooks.Open("C:\MyBook.xls")
    Set xlSheet = xlBook.ActiveSheet

    xlSheet.Range("A1").Value = "Hello, world!"
End Sub
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜