Call Function via User Interaction with Office Scripts in Excel Online - excel-online

Is it possible to trigger an Office Scripts function within Excel Online as a result of a user action? For example, can I run a specific Office Scripts function when the user clicks on a hyperlink within Excel Online? If so, can you give an example of the syntax/setup of the hyperlink?

It is not possible to trigger based on user-action; we are investigating allowing trigger through a shape/image (button). Would that be something that'll meet your requirement?
(I work on the product team)

You could try building a Flow (aka "a Power Automate") that is triggered on the "File Change event"(for the Excel file) in SharePoint. Instead of just having the Flow trigger on double-click you would need to enter data into the cell. Because the worksheet and, this, file changed the Flow would trigger. Good luck.

Related

TFS Excel Add-In: Change Query Source Programatically / Macro

I would like to change TFS Excel Add-in List Query programmatically using excel macro.
I have requirement to provide bulk edit work items functionality using ASP.Net Web Application. I am planning to create pre-defined excel template (Bind with Empty TFS Query) and copying it to web server. I am creating TFS Query programmatically based on user input (work item id) and downloading this template file on client when user request "Bulk Edit" functionality. I want to run macro which will update TFS Excel Query and refresh list pragmatically. I tried sample app to refresh TFS Excel list (https://blogs.msdn.microsoft.com/team_foundation/2010/11/06/programming-for-the-tfs-excel-add-in/) which is helpful but I would also like to change "List Query". I also tried accessing TFS Excel custom properties to change connection string or query but not sure which property and how? I need input for following items
Change TFS Excel Add-in List Query programmatically using excel
macro OR
Update TFS Excel Custom Property to update Server / Query
name and refresh list
Well, there really is no supported allready prepared way to do that. Here is the official doc from MSDN: https://www.visualstudio.com/en-us/docs/work/office/bulk-add-modify-work-items-excel

Automate report download from SAP Business Object Infoview

I am new to SAP Business Objects Infoview and was asked if I can automate the report data generation for an existing report.
Here is what I would do manually through the Infoview web interface:
Click schedule for the report in question, which brings up the Schedule dialog
Change the recurrence to Now
Change the report prompts (start date and end date) so that start date=today and end date=today-14 days
Set the format to CSV and output the report to the Inbox
Schedule the report
Wait for the report to succeed
Download the generated report data
I can see how I could build a tool using Java and Selenium to automate this. However I am wondering if there is a more elegant way to doing this that still allows me to set the prompts dynamically. Are there existing 3rd party tools? Can I use JDBC?
What I have at my disposal is a user name/password to log on to Infoview. If a more elegant solution requires additional access or software please let me know.
It's possible with a simple addition to the universe (but this, of course, requires universe developer access). For your example, you could create a new universe-based Predefined Condition object with a definition of: (assuming Oracle)
start_date = trunc(sysdate) and end_date = trunc(sysdate-14)
Adding this object to a report will produce the desired timeframe whenever it's run, whether it's scheduled or interactive.
If you want the same report to run with this logic when scheduled, but still allow users to select dates via the prompts. You can use magic dates. See this blog post for info.
Lastly, you could write a custom program that would open the report, populate the prompts with the appropriate values, and run it. But I would consider that a less-preferable option than the ones above.
You can use UiPath in order to easily automate SAP GUI without writing code.
Here's a tutorial on how to automate data entry, menu navigation and screen scraping on SAP.
You can use it from code (SDK) or you can create workflows (visual automation) directly from UiPath Studio.
Note: I work at UiPath. You should also try other visual automation tools like Automation Anywhere, WinAutomation, Jacada, use them side by side and choose the one that suits better your needs.
Here's how automating SAP Business One menus, buttons and typing looks like:

Creating Spreadsheet from SQL using ASP - Can I attach macros?

So I have been using ASP for all of a week now and perhaps this is something that I just can't do, but I am trying to dynamically generate reports from data stored in a SQL database. I am publishing the reports through an ASP document and displaying by specifying Excel for the MIME content type:
Response.Buffer = TRUE
Response.ContentType = "application/vnd.ms-excel"
Is it at all possible to "attach" macros to the document? I understand I can do basic formatting in the HTML, but I would prefer to import the desired database data and handle it within excel via macros.
EDIT:
I have several reports I need to generate but for one example:
I want to load retrieved data from the database into a sheet in excel.
Attach Macro
Begin Macro:
Hide the specified sheet.
Programatically create new sheets for categories of data.
Format sheets.
The question is not about how to program the macro, just whether or not a macro can be attached and how to achieve this. In regards to alerts upon opening the sheet, if I can attach macros I should, theoretically, be able to suppress those in the Open Workbook event.
EDIT: I believe I can achieve the desired result by using OWC (Office Web Components) (see http://support.microsoft.com/default.aspx?scid=kb;EN-US;288130). However, I am not sure if I will be able to install it on our Web Server. Any other suggestions?
While it is possible in a strictly technical sense, it is neither simple nor advisable. The recipient of the sheet will get multiple prompts related to the security of your macros; the source of your macros; and if they really, truly, honestly meant to click to enable macros...

Can an Access macro be saved as an add-in to be used in another Access database?

I am doing some work within MS Access and I have come across a rather annoying hurdle. I have written up some code and created a macro to execute said code. My issue is that I would like to be able to execute this macro from any project.
As of right now the only way I can run the macro/code for a new project is to create a new module paste in the code and then create a new macro to run said code. Is there a way to capture this macro/code into an addin or save the macro globally so that it is available any time an access project is open?
You can create a reference to an Access database in the same way as any other reference. Once you do, you can run any code it contains.

Writing data back to SQL from Excel sheet

I know it is possible to get data from a SQL database into an excel sheet, but i'm looking for a way to make it possible to edit the data in excel, and after editing, writing it back to the SQL database.
It appears this is not a function in excel, and google didn't come up with much usefull.
If you want to have the Excel file do all of the work (retrieve from DB; manipulate; update DB) then you could look at ActiveX Data Objects (ADO). You can get an overview at:
http://msdn.microsoft.com/en-us/library/ms680928(VS.85).aspx
You want the Import/Export wizard in SQL Management Studio. Depending on which version of SQL Server you are using, open SSMS (connect to the SQL instance you desire), right click on the database you want to import into and select Tasks.. "Import Data".
In the wizard, click Next (past the intro screen) and from the Data Source drop list select "Microsoft Excel". You specify the path and file name of the Excel spreadsheet, whether you have column headings or not.. then press Next. Just follow the wizard through, it'll set up the destination (can be SQL Server or another destination) etc.
There is help available for this process in SQL Server Books Online and more (a walkthrough) from MSDN.
If you need something deployable/more robust (or less wizard driven) then you'd need to take a look at SQL Server Integration Services (for a more "Enterprise" and security conscious approach). It's probably overkill for what you want to accomplish though.
There is a new Excel plug-in named "MySQL for Excel" : http://www.mysql.com/why-mysql/windows/
I just had a need to do this, and this thread has been quiet for a long time, so I thought it might be useful to supply a recent data point.
In my application roving salespeople use a copy of an Excel workbook that tracks the progress of a prospect through a loan application. The current stage of the application needs to be automatically saved back to a remote SQL database so that we can run reporting on it.
Rejected methods for updating the database from Excel:
SSIS and OpenRowSet are both methods for allowing SQL Server to pull the data from Excel, and don't work very well when the Excel workbook is sitting in an undefined location on a user's computer, and certainly not when the workbook is currently open in Excel.
ADO is now, if not actually deprecated, nevertheless looking very long in the tooth. Also, I wanted the solution to be robust in the face of the user possibly not being connected to the internet.
I also considered running a web API on the destination server. Macros in the Excel workbook connect to the web API to transfer data. However, it can sometimes be painful to allow a web API to talk to the outside world. Also, the code to make it robust in the face of temporary loss of internet connection is painful.
The adopted solution:
The solution I plan to adopt is low-tech: email. Excel emails the data to an address hosted on an Exchange server. Everyone in the company has Outlook installed, so the emails are sent by programmatically adding them to the Outlook Outbox. Outlook nicely handles the case when the user is offline. At the server end, a custom C# executable, fired up at regular intervals by the Task Scheduler, polls the inbox and processes the emails.
You could use try these add-ins :
www.QueryCell.com (I created this one)
www.SQLDrill.com
www.Excel-DB.net
You can use the OPENROWSET function to manipulate Excel data from a T-SQL script. Example usage would be:
UPDATE OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;DATABASE=c:\MySpreadsheet.xls',
'Select * from MyTable')
SET Field1='Value1' WHERE Field2 = 'Value2'