ms-access vba - read from excel and also update that excel

丶灬走出姿态 提交于 2019-12-01 13:37:54

S o l v e d !!!

Here is the code that works without hiding my entire workbook :

Private Sub Command0_Click()
    Dim my_xl_app As Object
    Dim my_xl_worksheet As Object
    Dim my_xl_workbook As Object
    Set my_xl_app = CreateObject("Excel.Application")
    Set my_xl_workbook = my_xl_app.Workbooks.Open("D:\Dropbox\MASAV\HIYUVIM\AAA.xlsx")
    Set my_xl_worksheet = my_xl_workbook.Worksheets(1)
    my_xl_workbook.Sheets(1).Range("A1").Value = "V"
    my_xl_workbook.Close SaveChanges:=True
    Set my_xl_app = Nothing
End Sub

Got the answer right here in this this forum, in another thread which escaped my eyes...

Thanks a lot to all in this wonderful forum!!!!

Mirek F.

Use this:

Workbooks(1).Windows(1).Visible = True
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!