如何使用VBA从MS Access更改Excel工作表中单元格的值?

时间:2021-09-23 15:42:18

How to I change a value of a cell in an Excel worksheet from MS Access using VBA? Thanks!

如何使用VBA从MS Access更改Excel工作表中单元格的值?谢谢!

            ....
            Set objApp = CreateObject("Excel.Application")

            objApp.Visible = True
            Set wb = objApp.Workbooks.Open("fileHere.xls", True, False)

            'Below does not work (Title is in cell A1):
            wb.Sheets(1).Rows(1).Insert ("Replace Title Here")
            ....

1 个解决方案

#1


5  

Try

尝试

wb.Sheets(1).Range("A1").Value = "Replace Title Here"

#1


5  

Try

尝试

wb.Sheets(1).Range("A1").Value = "Replace Title Here"