Excel stops running protected workbook, runs fine if unlocking it - excel

I have a tool, which uses VBA.
As the tool has company secrets, the project is password protected to avoid the info getting into the wrong hands (to some extent). Therefore, as soon as anyone wants to "view code", they have to put in the password.
The tool has a simple GUI, which just loads values from various worksheets and displays them with simple VBA controls.
In some version updates of the tool, excel stops running when trying to load the GUI. No error codes are displayed. In others, work just fine. I don't know what causes this. The updates are simple changes to formulas, updating of price structuring and the like.
If i put in the password before loading the GUI, it works just fine. This, however, is not a good workaround if i want to deploy the tool to anyone who is not authorized to view the internal info.
Any ideas how to debug this issue?
Windows 10 64-bit
Excel 365
Dell Latitude PC

Related

Convert VBA user form into Android mobile application is there any way to achieve this?

I designed an user form in VBA. I key in data in the user form and entries get registered in the excel automatically in the background.
However, I was wondering if there is any way to convert VBA desktop user-form UI into mobile application. So that, I am able to key in data from the desktop and as well as Android(exactly same UI) with the data being entered in the same excel sheet- basically ,allowing me to do the same job while I am away from my laptop.
I have so many buttons with different functionalities in the user-form. I coded them in VBA modules. I need to achieve the same objective in the android app as well.
Please, if anyone have any resources, please refer it to me. I couldn't find the solution on YouTube.

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?

Refreshing Excel Data connection on a Windows Server

I am running an automated Data job on a windows server that outputs a SAS dataset everyday. On top of this, I have an Excel Report connected via Excel's Local Data Provider.
My problem is, that the Data Connection needs to be manually refreshed by a person with SAS installed on their PC. I have tried writing a piece of SAS code that opens the Excel file on the server and then triggers a piece of VBA that did the refreshing, before closing and saving. This works perfectly if I'm logged into the server. But it doesn't seem to work if nobody's signed in. I believe this has something to do with having an active user session.
UPDATE
The process that I use to connect to a local data source from Excel, looks like this:
Data Connection Wizard
Select SAS Local Data Provider from OLE DB Providers
Add the Route to my SAS Dataset as data source
Select My source table and create a Pivot Report
Is there any way to do something like this?
When you want to run Excel unattended, thus no interactive user is logged on, you can do this with a Windows service. You have to ensure some settings for Excel, as well as it is important how you start excel.
Be aware of Microsoft does not support, or even suggest you to do something like this. Excel is a client software, it is exactly the opposite of a piece of software that is easy to maintain running as as service. Read this excellent article Considerations for server-side Automation of Office about the topic. Even when a little old (talking about Office 2003) it is still state of the art.
Please consider these conditions:
You cannot use the System or Network account, you have to let the windows service running under an account that at least have excel started once. This cannot be done with the named ones (as they cannot be used as interactive users)
Excel has to be opened at least once with the user under with the windows service account will run. You'll have to configure dcom settings, open vba once to initialize it, and most probably set some settings like "trust vba model" to be able to programmatically access Excel
last but not least when starting Excel you have to start it with loading the user profile. The Process.Start method in c# allows exactly that by just setting a boolean value to true.
Doing it like this, Excel should just start fine and update data connection with the VBA.
You may want to implement that windows service in c#, as it is really easy, have a look: Creating a Basic Windows Service in C#.
When using c#, be aware of you have to correctly dispose interop objects, pretty good described in How to properly clean up Excel interop objects

Outlook 2013 detected a slow addin

I developed an Addin which consists of Login and the data entry and retrieval functionality. The data entry and retrieval are accessed through REST URL's. The Outlook Startup doesnt has any code, except it checks the outlook version. I implement a plain form which show the user "loading message" initially and the rest of the logic will be handled by a thread. So i hope everything is followed according to the performance, but still i am receiving an addon error as "Outlook Detected an Addin Problem" The Add-in caused outlook to start slowly. I am able to overcome this problem and more and more i am able to get the time statistics for application start or shutdown events. couldany help me how do i resolve this?
Are you trying your AddIn in a debug mode or through an installer ?
First of all, make sure that it has been disabled because it is slow and not because it has errors.
If it has errors, it will cause Outlook to work slowly or even crash.
If it just working slowly, you can try to optimize your AddIn, go through your code again and see what you can do again in a less performance consuming way.
One other thing you can do is, when you will create a setup project for your AddIn to run an installer (instead of debug), you can set your Load Behavior to 16 in the registry.
This will cause the AddIn to load at Outlook startup on the first time after installation and to load on demand the other times. (Load on demand means when the user clicks on the AddIn icon).
This way, your AddIn won't slow Outlook down, except for the first time.

Unable to create Excel macros on particular machine (possible Windows Group Policy issue?)

I have a Windows 2003 Server box with Excel 2010 installed, upon which I am unable to create new or execute existing macros in spreadsheets. Note: this machine is in a Windows Domain (and I am not getting much help from the network folks here.)
I can and have edited the macro security levels within Excel (File, Options, Trust Center, Macro Settings --> Enable All Macros) but despite this, when I try to:
Open a spreadsheet with macros, I get an exception "Excel found unreadable content...." which goes on to refer to the VBA macros within the spreadsheet
Create a new macro in a brand new spreadsheet created on this machine, all the toolbar buttons providing access to the VBA editor are disabled.
Could this be a Group Policy setting that allows me to edit the macro security settings, but overrides these settings and prevents me from actually creating, editing, or executing VBA macros? (If so, does anyone happen to know which group policy setting I should be looking for?)
I've run rsop.msc (Resultant Set of Policy) on the machine and looked through every single thing under both Computer Configuration and User Configuration, but I don't see anything related to Excel (or Office) Security/Macros.
In this case, the problem was that Visual Basic for Applications hadn't been installed when Excel itself was installed.
(As usual, Microsoft could do a much better job of alerting the user to this unusual configuration, but what can you do.)

Resources