Hello friends,
Did invoke code VBA require Office to be installed in the machines?
Hello friends,
Did invoke code VBA require Office to be installed in the machines?
Hi!
for invoke code activity you don’t need to install the office. but it depends on the code what you’re trying to perform. if it is about excel you can use workbook activities. that doesn’t require to install any office.
please check this
Regards,
NaNi
OK, did anyone tested this ?
Hi! i didn’t get you. if you wants to know more about invoke code have a quick view on this
Invoke Code.zip (11.5 KB)
Regards,
NaNi
My aims is to run invoke VBA for the code below:
Dim excel As Microsoft.Office.Interop.Excel.ApplicationClass
Dim wb As Microsoft.Office.Interop.Excel.Workbook
Dim ws1 As Microsoft.Office.Interop.Excel.Worksheet
Dim ws2 As Microsoft.Office.Interop.Excel.Worksheet
excel = New Microsoft.Office.Interop.Excel.ApplicationClass
wb = excel.Workbooks.Open(in_Path)
ws1 = CType(wb.Sheets(in_WorkSheetSource), Microsoft.Office.Interop.Excel.Worksheet)
ws2 = CType(wb.Sheets(in_WorkSheetDestination), Microsoft.Office.Interop.Excel.Worksheet)
ws1.Range(“A1:R20”).copy.ToString
ws2.Range(“A1”).PasteSpecial(Microsoft.Office.Interop.Excel.XlPasteType.xlPasteValues)
wb.Save
wb.Close
excel.Quit
ws1 = Nothing
ws2 = Nothing
wb = Nothing
excel = Nothing
GC.Collect
=> it copy data from a sheet to another.
the machines where this code will be run did not have Office installed for secutity purpose.
that’s why i’m asking this question
Hey!
if you don’t wanna install Ms Office you can use Workbook activities.
workbook activities will work with/without installed office in a machine.
for more details please refer below about workbook activities
Regards,
NaNi
I know that,
but i can’t perform this activity using workbook (there is a complex Excel formula in the source sheet) , that’s why i’m using VBA
so i’m wondering if there is a need to install office to run VBA code