Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hm, well I managed to fix problem #2 heh. And apparently problem #1
was because I had the absolute path in quotes. As soon as I got rid of those it started working (although I still think it's strange since quotes around file path names i thought was syntactically correct..and sometimes even necessary when the filepath has spaces). Well, if anyone out there was having the same problem as me, here is how I fixed it: Dim XLapp As Excel.Application Set XLapp = New Excel.Application Dim WB As Excel.Workbook Dim WB2 As Excel.Workbook Set WB = XLapp.Workbooks.Open(foo.xls) ' file that has the macro that i want to execute Set WB2 = XLapp.Workbooks.Open(file.xls) ' xls file that i want the macro to operate on XLapp.Run "foo.xls!" & macro_name ' Note the exclamation point after foo.xls ' After everything is over let's clean up WB.Close False WB2.Close False XLapp.Quit Set WB = Nothing Set WB2 = Nothing Set XLapp = Nothing |
Thread Tools | Search this Thread |
Display Modes | |
|
|