Excel ActiveX controls changing size with resolution still not fixed? - vba

OK, this might be a bit of a generic and repeated non-code question but the latest article I can find about this is from over 2 years ago, so I'm wondering if there's been a fix or an update or maybe some clever dude out there has cracked the secret to curing this.
Every time I extend my screen while Excel (2007, 2010 or 2013) is running, and every time I unplug from an extension while Excel is running, my ActiveX controls are rendered useless, because with each click they either shrink or get bigger, depending on if I extended or unplugged.
This happens until I close the Excel application and restart it, unfortunately if I've saved it while the buttons are bigger/smaller they might end up stuck like that.
There is a thread here which has a bit code to help deal with the issue but quite frankly I'm hoping by now, two years later, someone has a slightly more efficient method of dealing with it.
I've took to using hyperlinks to run macros now but that's no good for my drop-boxes and things. And for me personally, I can just make sure I close Excel before extending/unplugging, but the real issue is I'm developing apps for people around the company and it's starting to cause problems with these damned buttons.
Does anyone know of a definitive fix for this yet?

If you only need ActiveX buttons to run macros, use Shapes instead. You can assign macros to a s shape's Click event. Right-click the shape and select "Assign Macro".

Related

How to change the appearance of a button once it has been clicked in libre impress

I have what should be a fairly straightforward question regarding libre impress. I want to make several buttons to jump around the document and I would also like these buttons to indicate that they have been clicked before.
To achieve this I used simple shapes (stars in my case) and added an interaction feature to jump to the desired location. So far so simple. In order to indicate that a button has been clicked before, I thought the easiest way would be to change transparency, colour or size of the shapes. Really any of those would be fine for me. I thought this could be done with a macro. My problems are the following:
I don't know how to write the macro. I have a rudimentary understanding of scripting (mostly Python) but not with this particular language.
I don't seem to be able to attach two interactions to one object (i.e. one for the jumping and one one for the macro to change the appearance).
I hope that there is a simple solution to this. Thanks in advance!
The tag is for Basic, so I'll go with that. However, LibreOffice macros can also be written in Python. To get started with Python macros, use APSO and check out this tutorial.
Anyway, here is some Basic code for Impress to point you in the right direction.
oDoc = ThisComponent
oDrawPage = oDoc.getDrawPages().getByIndex(0)
oShape = oDrawPage.getByIndex(0)
mri(oShape)
MsgBox(oShape.getControl().Label)
Whether you decide on Basic or Python, get the MRI extension in order to discover UNO properties of an object. This way you can find out how to change the button.
When you have some code, post another question or edit this one that shows the code you have so far, and describe problems you encountered.

Can’t find Library or Project Excel VBa

I’ve run into an issue with a couple of workbooks where the message “Can’t find library or project.”. However, when I open the VBA window to check the references, it’s non responsive (as in I can click things, but no menus appear, the project window displays the desktop, and Active X controls are non responsive).
I’m in Excel 2013. Is it possible that if the file was created in 2010 and brought over there could be issues? I’m acratching my head as this seems to happen completly at random.
Thanks guys. I managed to open the file in Safe Mode, and tried compiling the code. I believe that there was an error in the Workbook Open code that it may have been corrupting on. I deleted this, and it seems to be all good

Word cannot undo this action. Do you want to continue?

I have a document into which I copy all kinds of VBA code regarding questions asked on this site and write code in preparation for answers. This document was created on my PC (with Word 2010). It has no event procedure that runs on the Save event, but at some point a few weeks back it started to ask me the above question before every save, including automatic saves. The document is based on the Normal template which has no code in it. I don't know which code may have caused this to start, nor which code to even suspect. Other documents open in the same instance of Word save normally. It's only this one document that is affected.
The document also contains a lot of special items, like content controls, fields, ActiveX controls, EndNotes, tables and comments. I suspect the comments to be related to this problem in some way.
I know that I could probably stop the alerts by disabling alerts but that isn't what I want. I want Word to display all the normal alerts. It's just this abnormal one which I would like to switch off. Any ideas how to do that? Or what caused Word to issue that alert in the first place?
In these situations I make several backups of the document and then start looking for something that is broken. So using a new backup each time, I systematically delete portions of the document to see if the unwanted / unexpected behavior disappears. For example I first try to isolate the issue to the top of bottom 1/2 of the document. If I can establish that the issue is related to the bottom half then I delete half of the bottom half of the document and so on... it can take a while but it has been an effective method of finding issues for me.
That said, I tried this on a document recently and just ended up going round in circles. I thought I had narrowed the issue down to a single corrupt image, but that turned out to be NOT the case.
I've also found that there are some things that I can do with VBA that Word simply can NOT undo... I'm only aware of a few things (which I'd have to look up in my notes) but I'm sure there's a whole list of things.
A possible workaround might be to clear the undo history for this specific document prior to saving, I imagine that will suppress the message and save you from losing the standard notifications. Hope it helps :)
Good luck!

Issues when upgrading from Excel 2010 to 2013

I've been working on a dashboard for the past several months in Excel 2010 and was nearing completion when we were upgraded to Excel 2013. I have experienced one issue that I'm completely stumped on...
I built a simple UI for the dashboard utilizing the first several rows of each sheet. Essentially, each sub-menu is hidden in a different row and only the appropriate rows are visible at any time. Is also allows the user to toggle on/off the various menus in/out of view without using a userform.
Prior to upgrading to 2013, it was very snappy and responsive, taking around 0.05 seconds each time a change was made in the UI. However, after migrating to Excel 2013 the UI is very sluggish. At first I thought it was a screenupdating issue because the screen was updating in bits and pieces - the labels, hidden rows, background color, etc would come in chunks, instead of all at once. I've ruled that out as a possibility.
I also tried disabling all of the annoying new animations that are baked into 2013. I tried all of the different methods I saw out there online - disabling the hardware graphics acceleration, turning off unnecessary animations in the ease of access center, etc. That too seems to have no effect.
After a full day of troubleshooting, I've noticed a sheet with just the UI and nothing else runs just as snappy as before. It's only when there are objects on the worksheet that things go wrong. From what I can tell, shapes and text boxes seem to have no effect on performance. Labels, both form control and Active X, seem to be the culprit.
I've noticed that the little bits of code I have for the UI continue to run at the same speed, but the screen will continue to change even after the procedure has run. This also totally perplexes me. I have tried changing the property from Move and Size with Cell to Free Floating and neither seems to make any difference. I've also tried changing things like Print Object, Locked, etc.
I'm totally stumped as to how to resolve this issue. It's definitely something endemic to 2013 as the exact same file runs without issue on 2010. If anyone has any suggestions they would be greatly appreciated.
UPDATE: Here is a link to a sample file highlighting the issue. Both work fine when tested on 2010.
https://www.dropbox.com/s/r2ep5bgyn6ohjph/2013%20Issue.xlsm?dl=0
Granted this is a stretch, but a little bit of research tells me that Excel 2013 has suffered a number of problems with ActiveX controls. There were several patches Microsoft has released, so I recommend you install them first and make sure your copy of Excel 2013 is completely up to date.
https://support.microsoft.com/en-us/kb/3025036
https://support.microsoft.com/en-us/kb/2956145
If this does not fix the problem, please let me know and I will remove this answer.
All, thanks for your help. I finally solved the issue I was having. I isolated the problem to Form Controls or ActiveX controls being visible at the time the code is run. I'm not sure why but the presence of either creates an issue. However, hiding all shapes prior to running the code and then unhiding them after resolves the issue. I did notice, however, this solution only works if the code does NOT turn screenupdating off prior to execution. I will post an updated file later when I have access to dropbox.

MS Office PowerPoint VBA Programming support or Debug Mode?

I am trying to develop a little macro for PowerPoint using VBA. However, the "Development Environment" is an absolute nightmare!
The worst: there seems to be no real good way to generate debug output! I read that the Debug.Print output is supposed to go to the Immediate Window, but nothing appears there! So I am currently using MsgBox to generate debug messages. :-(
What's also really bad is, that errors in a macro always crash PPT. So one has to wait, until it is gone and then one has to restart it again and get rid of all the Recovery attempts. This always takes ages!
If I set On Error Resume Next it doesn't crash - at least not as often - but then things just silently don't work and I can't see what and why things go wrong (unless I plaster the code with MsgBox calls, but that requires 100'000 clicks during each execution).
And running the code in the debugger and single stepping trough the code doesn't work, either, since my macro refers to the current "ActivePresentation" and that doesn't seem to exist unless one starts the slideshow mode. So this debugging is driving me nuts!
Is this really the only possibility or environment to develop VBA code in? At least some idea re. debug output, anyone?
M.
The worst: there seems to be no real good way to generate debug output! I read that the Debug.Print output is supposed to go to the Immediate Window, but nothing appears there!
At the risk of sounding insulting (which I don't intend!) do you have the Immediate window open? While in the IDE, press Ctrl+G to see if anything new appears. If so, that's the Immediate window.
What's also really bad is, that errors in a macro always crash PPT.
Not ordinarily, no. It can happen that way, of course; your code might be triggering a bug in PPT. Heaven knows, I ran into enough of that in PPT 2002 and 2007. If you're using reasonable error handling and still running into errors that crash PPT, stepping through the code as it runs should allow you at least to narrow it down to the line or two that cause the crash.
And running the code in the debugger and single stepping trough the code doesn't work, either, since my macro refers to the current "ActivePresentation" and that doesn't seem to exist unless one starts the slideshow mode.
Again, no. The ActivePresentation refers to whatever presentation has focus in the app, whether it's in slide show or any other view. If your code's in one presentation and its' supposed to be acting on another, that can cause some confusion, but you simply need to switch to normal view, make sure the presentation you want to access is visible (I'd make sure not to have several in view) then Alt+F11 to return to the IDE and run your code.
All of these suggestions apply to any Windows version of PPT, going back to Office 97 (Mac? Thinks different. If you're using a Mac, mention that. There are a few differences but for the most part, everything above applies except for the Alt+F11).
If none of this seems to help on your setup, it may be time to do a repair of Office.