hi everyone,
i'm trying to create o vbscript to run a macro in an opened workbook, i managed to create one but my problem in whenever i run the script the workbook get opened again even if it's already opened.
can you help so i can be able to do the following,
the workbook will be opened manual
when i run the script a macro will run and update the cell "A1" by adding "1" cell value will be "2", if i run the script again cell "A1" will be "3" next run "5"....
i don't need the script to save or close the workbook.
bellow is the script i am using at the moment.
Dim xlApp
Dim xlWkb
Set xlApp = CreateObject("excel.application")'
Set xlWkb = xlApp.Workbooks.open ("C:\Users\elife\Desktop\project.xlsm")
xlWkb.RunAutoMacros 1 'xlautoopen
xlApp.Run ("table1")
xlApp.Visible = True
Set xlWkb = Nothing
Set xlApp = Nothing
thank you
Bookmarks