I have an Excel automated task that requires an add-in. Use of the add-in requires separate authentication.
There is no way to pass my credentials. I have to manually authenticate when the add-in loads. Because the old-fashioned way launches a new (unauthenticated) instance, I can't figure out how fully automate tasks that require the add-in.
I know that I can use getObject to find the add-in names by using this Add-in Objects within Excel:
For i = 1 To AddIns.Count
Debug.Print (AddIns(i).Name)
Debug.Print (AddIns(i).FullName)
Debug.Print (AddIns(i).Title)
Debug.Print (AddIns(i).Installed)
Debug.Print (AddIns(i).FullName)
Next
This would show the add-in names, in which I can find the add-in by using
Set MyObject = AddIns("addin name")
or using findWindow(Windows API) to find the add-in instance
hWnd = FindWindow(vbNullString, "Add-in Login Window Title")
Reference link on the WindowsAPI getobject and also reference function for Findwindows and SendMessage http://msdn.microsoft.com/en-us/library/office/gg251785(v=office.14).aspx
The addin login windows looks like following:
I am stuck on how to pass the credentials to this add-in window by referring either thru the object or HWND.
There are some helpful posts: Open an Excel file in running instance of Excel with Task Scheduler. and Open an Excel file in running instance of Excel with Task Scheduler
How can I do authentication thru Windows API, not necessarily thru VBA? I could use Python as well.