I'm trying to create a file to store on my desktop which i can use to open all the application i used everyday (usually i leave my PC open at night but this is usefull after a restart). I wantt o do the following:
1. Open Outlook (and the VbaProject.OTM normally opening with it because I have macros running when mail arrive in Outlook)
2. Open a file containing timers for several macros running during the day
2. Open 2 others excel applications
- one with a file (also with a timer)
- one with 2 files with password protection (this needs to load all the usual add-ins, especially Bloomberg add-in (a data provider)).
I've writen a small code but somehow the excel appication don't open the same way as when i go to the start menu and open excel. The add-ins don't open as usual. Any idea why? As i only know VBA, i've written this code in a macro running when an excel file is open. It opens the rest and then close the file containing this macro. If someone knows a better way (a scipt or bat file?)
Addins not openning:
- 3 Bloomberg installed addins
- UBS installed addin
Const MyRoot As String = "Y:\"
Private Sub Workbook_Open()
Dim Xlapp2 As Object, Xlapp3 As Object
Dim OutlookApp As Object
Dim Xlwb1 As Workbook, Xlwb2 As Workbook, Xlwb3 As Workbook
Dim Path1 As String, Path2 As String, Path3 As String, Path4 As String
Set OutlookApp = CreateObject("Outlook.Application")
OutlookApp.Visible = True
Path1 = MyRoot & "Excel_Models\DailyUpdater.xls"
Set Xlwb1 = Application.Workbooks.Open(Path1)
Set Xlapp2 = CreateObject("Excel.Application")
Path2 = MyRoot & "Excel_Models\UBSVOLS_Timer.xls"
Set Xlwb2 = Xlapp2.Workbooks.Open(Path2)
Xlapp2.Visible = True
Set Xlapp3 = CreateObject("Excel.Application")
Xlapp3.Visible = True
Path3 = MyRoot & "TRADING\GCF\Live_NAV.xls"
Set Xlwb3 = Xlapp3.Workbooks.Open(Path3, Password:="gcf")
Path4 = MyRoot & "TRADING\UCITSIII\Live_UCITS_NAV.xls"
Set Xlwb3 = Xlapp3.Workbooks.Open(Path4, UpdateLinks:=xlUpdateLinksAlways, Password:="ucits")
Set Xlapp2 = Nothing
Set Xlapp3 = Nothing