Excel VBA Disable message "Uploading to..." when saving to Sharepoint - excel

We have developed a client / server solution in Excel 2010 VBA. The Excel Database is hosted on a hidden document library on a SP 2013 Server. The client is a local workbook containing the data entry form.
We want to maintain secret the path to the hosted DB. The issue is that whenever the user commit changes via a dedicated VBA routine a pop-up message with title "Uploading to the server" is displayed with in message body: "Uploading..." and the full path of the server DB.
We have included all standard message disabling functions in Excel VBA:
Application.DisplayAlerts = False
and
Application.ScreenUpdating = False
but they do not have effect on this type of messages. Wondering if they are actually from Excel? They may come from IE or WebDAV? In any case they are displayed only when saving is taking some time.
The SP hosted DB is opened and closed as follows:
Workbooks.Open \OurIntranet\services\ContractsDatabase_hidden_\LIVE_DB\Database v01.04.xlsb, , False, , MyPwd
Application.DefaultSaveFormat = xlWorkbookNormal
UPDATING LINES -
wbk.Close
I have seen that also with DB hosted on a Network File Server the same message appears. So message box does not seem to be of SP origin.
Can someone help?
Thanks

Related

Open document from share point directly in office365

I'm using the graph API to access the documents in SharePoint. The response I'm getting looks like this:
graph api response
I want to let the user open this file (an excel file in this example) using excel desktop app. In other words, I want to resemble in my app the "Open in desktop app" functionality Excel for the web already provides:
excel for the web functionality
Is that possible?
Thanks in advance!
You can try and get the webUrl of the parent folder of the document you want to open. On that webUrl you add:
String documentUrl = parentWebUrl + "/YourDocumentName.docx";
And then you use Office URI scheme to open it localy (read more here)
It should be possible to do it using the webUrl of the document itself, but i have not figured out how to do it.

Save functionality in Excel Addin using OfficeJs and ReactJS

Background: I am developing an excel Add-in using OfficeJS library. The addin is using the ReactJS components and Office Fabric UI. The Add-in is successfully created and using OfficeJS library we can bring the user selection to the Excel sheet.
Problem: The problem is that I want to get the event in OfficeJS to Save the sheet using the Excel Native capability i.e., once user clicks on Save then the Save Dialogue box will appear(as per Native excel behavior)and on that I want to invoke my ReactJS business rules(some functionalities). In order to do that I want to use Save event for the same in OfficeJS which should be triggered automatically.
Code Sample:
Office.initialize = () => {
Excel.run(function (context) {
var sheet = context.workbook.worksheets.getItem("Sheet1");
context.workbook.load(["save"]);
context.sync().then(() => {
context.workbook.save(Excel.SaveBehavior.prompt);
//OR
context.workbook.save(Excel.SaveBehavior.save);
});
}).catch(function(error) {
console.log(error.debugInfo);
});
}
Research: The above two functions which I have tried are from the Microsoft Documentation where it is mentioned as:
Workbook.save saves the workbook to persistent storage. The save method takes a single, optional saveBehavior parameter that can be one
of the following values:
Excel.SaveBehavior.save (default): The file is saved without prompting the user to specify file name and save location. If the file
has not been saved previously, it's saved to the default location. If
the file has been saved previously, it's saved to the same location.
Excel.SaveBehavior.prompt: If file has not been saved previously, the
user will be prompted to specify file name and save location. If the
file has been saved previously, it will be saved to the same location
and the user will not be prompted.
System Configurations: I am using Windows 10, Excel 2016 Desktop and Office 365 Online version. I am using IE-10 and Google Chrome for Online version of Excel. Additionally I have checked the same using Windows-7 and Excel-2016 and same browsers.
Do let me know if the above functionality can be achieved?
Unfortunately, Office JS Excel API currently doesn't support onSaved event. one of the reasons was that Excel has an autosave feature, which triggers save action frequently. So we worry to provide onSaved event may fire too many event notifications to customers.
But I would suggest that you could submit the request and upvote this request at uservoice

Automatically open Office documents on a Sharepoint Server 2013 in Firefox (full Office integration)

I recently switched to Firefox. Unfortunately my company still uses Sharepoint Server 2013 (migration to Sharepoint Online is planned somewhere in the future) which no longer offers a fluid integration with Office.
Every time I want to edit an Office document, it gets downloaded instead of being 'forwarded' to be opened by Word, Excel, etc. Modifications need to be saved locally and than uploaded afterwards. This is hugely annoying.
Is there some way that I can automate this in code, using a Firefox extension? Does Sharepoint expose some kind of hook or metadata containing the document's URL?
(Self-answer originally provided by Dotsoltecti; copied from question body into a proper answer).
Sharepoint 2013 passes the document's URL via the right-click contextual menu.
There exists a very neat add-on for Firefox called "custom right-click menu" by Sander Ronde. After installing this extension I added the script below:
var feedback = crmAPI.getClickInfo();
var url = feedback.linkUrl;
if (url.endsWith("docx") || url.endsWith("doc")) { var uri = "ms-word:ofe|u|" }
if (url.endsWith("xlsx") || url.endsWith("xls")) { var uri = "ms-excel:ofe|u|" }
if (url.endsWith("pptx") || url.endsWith("ppt")) { var uri = "ms-powerpoint:ofe|u|"}
var toOpen = uri.concat(url);
window.open(toOpen);
Et voilĂ : right clicking on a Word/Excel/PowerPoint-document executes the script and correctly forwards the document to the said program (you have to whitelist your SharePoint-site with the pop-up blocker). Modifications are handled directly by the Office-program.
Only drawback so far is that every time a document is opened, a new blank window is generated. I haven't found a solution for that yet, so suggestions are always welcome.

BizTalk "New" SharePoint Adapter Send Document Silent Fail

I have a BizTalk 2016 solution. It's collecting a document (Pdf or Word) from a varbinary(max) column of a Sql Server database, along with some metadata. So, the message that makes its way to the messagebox from the Sql Receive Port looks like:
<TypedPolling xmlns="http://schemas.microsoft.com/Sql/2008/05/TypedPolling/ReadyForBizTalk">
<TypedPollingResultSet0>
<TypedPollingResultSet0>
<Id>3</Id>
<DocId>104</DocId>
<Uprn>76675</Uprn>
<Address1>48 Cardinal Square </Address1>
<Address2>City</Address2>
<Address3>County</Address3>
<Postcode>AF1 5FF</Postcode>
<Title>Doc title</Title>
<DocType>Pdf</DocType>
<Version>-1</Version>
<Date>30/01/2019 14:46:26</Date>
<Description>Description</Description>
<FilePath />
<Extension>.pdf</Extension>
<SystemGenerated>false</SystemGenerated>
<Content>/9j/4AAQSkZJRgAB...</Content>
<ProcessedByBizTalk>false</ProcessedByBizTalk>
</TypedPollingResultSet0>
</TypedPollingResultSet0>
I want BizTalk to send this to send the binary document (content of the Content element) and the metadata "Title" value to a SharePoint 2013 document library. I have created a send port and configured the following properties:
Use Cleint OM = Yes
Destination Folder URL
SharePoint Site URL
Column 01 = Title
Column 01 Value = %XPATH=//Title%
I realise that I've not made any attempt to send the "Content" yet but I thought I'd try to get this simple case working first.
When I set a new rec to be collected from the Sql Server table, it is collected ok by BizTalk and I can see from Tracked Messages that a send is made through the SharePoint adaptor. There are no errors either in the BizTalk admin console or event log, but new item appears in the document library
I have a couple of questions:
Any ideas why nothing new is appearing on the doc library?
Once I'm able to persist "something" to SharePoint library, does anyone know how I can get the binary document into the library?

How can I get hidden properties in Excel that are passed with XMLHTTP requests such as userid?

I have an excel workbook that interacts with a webservice that has authentication. The first time I make a webservice request using VBA with XMLHTTP I have to enter my userid and password in a pop-up box from the webservice. Excel remember's the userid and password for each successive xml request that I make up until I close the Excel application. The REST webservice's authentication tool is stateless so I'm not keeping a connection. I have a need to capture the userid entered by the user to use it in the webservices URL for a GET request. Is there a way to capture the user's userid from Excel using VBA so that I don't have the prompt the user twice for the same information?
Katz, Thank you for the response. I am familiar with these functions. My scenario is different in that I am interacting with an external secure webservice that requires a different userid than my windows domain. In my case the webservice is stateless and each time I call it, it requires the userid/password unique to the service. When sending requests to this webservice through Excel using VBA, Excel somehow remembers the userid and password and as long as I don't close the instance of Excel, I do not need have to enter the userid/password interactively. I need to be able to extract just the userid from where ever Excel is sourcing this information so that I can place it in the GET request as userid can be used in the GET request as filtering criteria for the response from the webservice.
This userid has to be stored somewhere in excel or in the system enviroment to be reused when subsequent GET requests are sent to this webservice in order to suppress the logon window after the first request. Any help would be appreciated.
For a local file you can read the computername and username with this code:
Set WSHnet = CreateObject("WScript.Network")
UserName = WSHnet.UserName
UserDomain = WSHnet.UserDomain
Set objUser = GetObject("WinNT://" & UserDomain & "/" & UserName & ",user")
userfullname = objUser.FullName
Workbook.Sheets("Sheet1").Cells(1, 1).Value = Environ("COMPUTERNAME") & ", " & userfullname
maybe it works for you also in your online file

Resources