I have a VBA application. In this i need to call (URL)other enterprise application, when call happens it goes to authenticate the user with login credentials. based authentication it will proceed to next process. For this authentication previously I used internet explorer browser but IE is going to close soon by Microsoft. so i want make this process excel adding. When the url called it need to call the adding in excel right need to show the login page of application once user loggedin it need to diapprear.
I have tried basic addin template development using Visual studio. I have explored in internet but those are directing me to do fresh login page and do so. buti dont want to do this, just when we call the url it goes to some browser(we should configure it) with login page that need to populate in excel sheet right side.
below are code snippets of same.
Home.js
'use strict';
(function () {
Office.onReady(function () {
// Office is ready
$(document).ready(function () {
// The document is ready
$('#set-color').click(setColor);
});
});
async function setColor() {
await Excel.run(async (context) => {
var range = context.workbook.getSelectedRange();
range.format.fill.color = 'green';
await context.sync();
}).catch(function (error) {
console.log("Error: " + error);
if (error instanceof OfficeExtension.Error) {
console.log("Debug info: " + JSON.stringify(error.debugInfo));
}
});
}
})();
addin manifest xml
<Version>1.0.0.0</Version>
<ProviderName>T2V</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<!-- The display name of your add-in. Used on the store and various places of the Office UI such as the add-ins dialog. -->
<DisplayName DefaultValue="Infor M3" />
<Description DefaultValue="A task pane add-in for Excel"/>
<!-- Icon for your add-in. Used on installation screens and the add-ins dialog. -->
<IconUrl DefaultValue="~remoteAppUrl/Images/Button32x32.png" />
<SupportUrl DefaultValue="http://www.contoso.com" />
<!-- Domains that will be allowed when navigating. For example, if you use ShowTaskpane and then have an href link, navigation will only be allowed if the domain is on this list. -->
<AppDomains>
<AppDomain>AppDomain1</AppDomain>
<AppDomain>AppDomain2</AppDomain>
<AppDomain>AppDomain3</AppDomain>
</AppDomains>
<!--End Basic Settings. -->
<!--Begin TaskPane Mode integration. This section is used if there are no VersionOverrides or if the Office client version does not support add-in commands. -->
<Hosts>
<Host Name="Workbook" />
</Hosts>
Home.html
<body class="ms-font-m ms-welcome">
<div id="content-header">
<div class="padding">
<h1>POC</h1>
</div>
</div>
<div id="content-main">
<div class="padding">
<p>Choose the button below to set the color of the selected range to green.</p>
<br />
<h3>Sample testing</h3>
<button class="ms-Button" id="set-color">Set color</button>
</div>
</div>
</body>
VBA code for calling URL but i need to replace it with adding ralted code.
Dim browser As clsIE
Set browser = New clsIE
With browser
.IE.Visible = True
.IE.Navigate URL
End With
As I am replacing authentication with IE browser with other browser i need to change this part