Excel VBA Userform won't work on all computers - excel

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.

Related

Excel VBA can’t find project or library once I enable macros

I’ve done a LOT of googling about this and haven’t found anything specific to this situation. Apologies if I missed it.
I have a .xlsm workbook that has a few macros—-one to refresh connections to a Microsoft Access Database, one to refresh pivots, and one to save it to multiple locations.
When I open the file, I get the standard yellow security bar that some active content has been disabled—-but it used to just say ‘macros have been disabled’. When I check the macros, they are there.
BUT when I hit ‘enable’, there’s 2 issues:
it doesn’t enable anything and I have to go to the Trust Center to enable both Macros and External Data Connections. Before yesterday, I never had to do that.
Once I enable macros and external data in the Trust Center, suddenly I get an alert that VBA “can’t find a project or library” and all my macros are now gone.
When I reload the workbook, we’re back to where I started. I have one other workbook with this issue. The other 5 or 6 macro-enabled workbooks do not have this issue.
The issue with these docs persists across 2 other colleagues’ remote laptops. However, when I remote into the office and access the same files in the same folder using VMWare to remote into an office PC environment, they work just fine.
I have tried accessing Tools>References in VBA—-nothing happens when I click ‘References’. I have restarted. I have emailed the files from the VMWare environment to myself, and they don’t work. I have enabled all macros and data connections by selecting those radio buttons, but still have VBA throwing that error and my macros disappearing until I reopen the file.
I truly don’t understand. Can somehow the files be corrupted only when I access them from home? Is there any fix?

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.

Hidden Excel Application gets visible when user opens new workbooks

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

Excel 2010 open SharePoint file behaves differently from two client PC

There are two client PCs. PC1 has only Office 2010 installed and PC2 has multiple Office installed but office 2010 is the default installation.
The two PCs behaves strangely when open SharePOint Excel file. No files are checked out from SharePoint and no one is trying to access the same file at the same time. PC1 opens Excel file from SharePOint is read-only (don't have Check out button under File-> Versioning). PC2 opens Excel file from SharePOint is ok to edit (does have Check out button under File-> versioning, can add a new row and save directly).
What cause the check out button shown differently on different PCs even the files are in the same condition in the Share Point?
Added Notes here: I think this is totally related to the first PC. The first time (only the first time/can be edited in the second time) to open Excel file from client application side has the issue. I have checked Content.MSO and did see all files created and removed correctly so it is not Content.MSO issue.
Thanks,
YK

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