如何用vb.net打开指定的EXCEL文件并在SHEET1的A1建立超链接指向sheet2的B2

2024-11-02 11:24:42
推荐回答(1个)
回答(1):

Dim xx As New Microsoft.Office.Interop.Excel.Application '定义进程
Dim yy As Microsoft.Office.Interop.Excel.Workbook '定义工作簿
xx = CreateObject("Excel.Application") '创建Excel对象
yy = xx.Workbooks("sheet1")
yy.Worksheets("sheet1").range("A1")="sheet2!b2"
yy.Save()
yy.Close()
yy = Nothing
xx.Quit()
xx = Nothing '销毁组建释放资源