Hidden Excel Application gets visible when user opens new workbooks - excel

I am using Excel Interop inside my C# Desktop Application to open a hidden Excel Application in the Background, which reads data of some Excel files.
Works fine so far, until the user opens his own workbooks with the Windows Explorer. His Workbooks are opened in my Excel Application, which gets visible and the hidden workbooks too. Then he can close the Application, which crashes my Process.
Is there any possibility to get my Excel application blocked, so the user gets his own Excel Application if he opens workbooks?

Not exactly answering your question, but you can try using the OpenXML SDK to read the contents of the Excel files. Using this SDK, you won't be launching any instance of Excel at all.
Have a look at the following links for reference
https://msdn.microsoft.com/en-us/library/office/cc823095.aspx
https://msdn.microsoft.com/en-us/library/office/gg575571.aspx

Related

How to get objects and VBA functions to work in Excel for Office 365?

Created a workbook in Excel desktop that uses buttons and hyperlinks to run VBA functions. When
workbook loaded in browser-based Office 365, buttons do not appear and clicking hyperlinks gives
Sorry, we couldn't open this link. The link address may be invalid, or you may not have permission to open it.
How do I get desktop hyperlink and button functionality to port to Office 365?
You need to develop a Web add-in if you want to get your extra functionality working everywhere, see Excel add-ins overview. VBA is for Windows desktop applications only.

How to convert Excel macro enabled workbook for use on mobile phone?

I created a macro enabled workbook to enter information on the worksheet and to e-mail it.
I downloaded Excel for mobile but all macros are disabled.
Is there a way to make it so the workbook could be used on a mobile phone?
Unfortunately, the VBA engine does not function on the mobile version of Excel. Macro-enabled Workbooks (.xlsx) will open, but the macros will not run. Macro-enabled Templates (.xltm) and Add-Ins (.xla and .xlam) won't even open.
See Microsoft's support article Why can't I open my Excel File? for more information and a complete breakdown by file type and mobile OS.

Excel VBA Userform won't work on all computers

I have made a user's form using VBA excel code. Its working fine on my laptop however when I tried it on my office computer it doesn't work. I emailed the file to myself and downloaded it from Outlook in the office. Its a .xlsm file. It gives me an error message that macros have been disabled. I have already changed settings to enable macros and allow VBA projects. I reopened excel and checked again it still doesn't work. The downloaded file from outlook, when I click visual basic, it doesn't show me any user form or code at all. Not sure why.
My whole code is present in the user form part (file in a personal laptop). There is a button on "sheet 3" which basically opens the user form. Not sure if it's saving the code only locally on my computer. As per my understanding if it's saved in the file it should be a part of it even if its opened on any other computer. My laptop version is office 365 and office one is 2016. I am not an advanced user. Kindly advise what is the error out here.

Launch an add-in systematically when opening a file

I want to make an Excel Online file, then post its link or embed it in my website. Clicking on that will open the file in Excel Online. Moreover, I want certain Excel add-ins to be installed and even launched automatically.
Does anyone know if it is possible?
If it's impossible with Excel Online, is it possible for a normal .xlsx file (I will make it, and opening it in Windows systematically leads to install an add-in and even launch it)?
If you're looking to automatically open a task pane add-in when the Excel file is opened, check out this article in the documentation: https://dev.office.com/docs/add-ins/design/automatically-open-a-task-pane-with-a-document?product=excel. The Office OOXML EmbedAddin sample provides an example of implementing the autoopen functionality that's described in the article.
Along with Kim's answer to automatic opening of a task pane add-in, you can using OneDrive to handle opening a file in Excel Online using Microsoft Graph.
You're start by uploading you're .xlsx file to OneDrive using an Upload Session. Once you're file is on OneDrive, you can retrieve it's meta-data for the DriveItem. Included in this meta-data will be a webUrl property. This is a URL that, when navigated too, will open your file using Excel Online.

Excel VBA sharing addins between different read-only instances of same workbook

My team and I share this workbook on a network drive. This workbook utilizes a few custom add-ins necessary for some custom functionality. These add-ins get automatically installed by custom VBA code I have added without any action on the part of the user. It seems that only I can use the add-ins - other team members have problems trying to load the add-ins, they get this error:
Run-time error 1004 Unable to copy add-in to library.
The error occurs when trying to run
Application.AddIns.add(<addin_name>)
The add-ins are located only on the Windows network share. I've written the code to ignore the prompt for copying the add-in to addins folder on local drive, because I don't want this to happen. This is a very annoying problem because I cannot debug it fully myself, I need the cooperation of my team members which is limited. Help greatly appreciated, thanks.
I would suggest just opening the XLA read-only from the network drive as if it was a workbook (which of course it is) rather than using Addins.Add - opening an XLA makes it available to the Excel session so it will function as an addin without being in the addins collection.

Resources