VBA Ribbon validate imageMso - excel

I'm creating a custom ribbon in Excel, and I'm using ImageMso's for icons. I downloaded the full list of Icons from Microsoft, and tried to create a menu that displays them all for me to choose, but some of them are not displaying.
Is there any way to validate if an imageMso code does not work with the current version of windows, and display a placeholder in it's place instead of a blank icon?
Thanks,
Daniel

In my experience the short answer is no, but I also haven't investigated or attempted to resolve it with any great tenacity. If it doesn't show up I will retry with a different icon.
Note that I am not an expert by any means, but have been playing around with customUI for a while.
There is a great free Add-In I found that helps with speeding up the whole process of identifying suitable icons. It's worth checking it out.
https://www.spreadsheet1.com/how-to-use-imagemso-icons-in-excel.html
Josh
PS. I hear this is particularly an issue going into the Office 2019.

Related

excel active X buttons getting bigger every action

This is a question with the same title as here:
VBA Active-X buttons getting bigger with every action
I guess the problem is the same.
The question is nevertheless from 2014!!! and it does not really have an answer.
In my case the buttons were NOT created programatically, but just clicking in insert activeX control, button, and then click for writing the VBA behind.
In order to better illustrate the problem I made a video with my handy:
https://www.youtube.com/watch?v=hBiu2FfRxQU
IN the video you can see how every time a button is clicked it gets bigger.
as note aside I have to say that this only happens when I connect remotely with my computer via a think client. Nevertheless both screens are the same (i.e. have the same resolution).
This is of course very annoying because it makes almost impossible to use home working since connecting to my excel at work makes all the buttons go crazy in size.
As #TimStack and #jvdv has pointed out this is a known issue of Microsoft, i.e. a BUG, there since many years.
Hence there is no solution but workarounds.
So stay away from controlX if you don't want to get surprises.
I had faced this issue today itself. And found very strange solution to this problem.
I just tried to resize the button where I was facing the issue and it was solved.
Hope this works with you.

Excel power view is not working on my computer

When i try to create a power view report it just generates the following image:
Only after i close and re-open the excel i get the power View tab, but this image is still there and the data i want to visualize is not. Does anyone knows how to fix this issue?
i found only 1 related page on the net but this solution does not make a lot of sense, and anyway it only works with 2 computers:
https://answers.microsoft.com/en-us/msoffice/forum/msoffice_excel-mso_winother-mso_2013_release/excel-powerview-error-image/28564661-ebc1-426c-8f56-e6bb96d14d4a
Any help will be highly appreciated!!
Best regards,
Mihail
For anyone who might need this in the future.
You need to install Silverlight on your computer: https://www.microsoft.com/getsilverlight/Get-Started/Install/Default
If issue is till not fixed, install the enable controls from here: https://gallery.technet.microsoft.com/scriptcenter/Registry-keys-to-reenable-7cd9f723
Now it should work!
Best regards,
Mihail
The same happened to me in Excel from MS Office Professional Plus 2016.
I downloaded the EnableControls pack and executed EnableSilverLight.reg.
Then I was able to click the Power View button and create a "Power View1" tab, but instead of Power View panes I get only that same image.
But then I found, by this (https://answers.microsoft.com/en-us/msoffice/forum/all/powerview-image-error-in-office-365-online/81baa2c5-1c9c-4d36-b424-60ad59696005) answer in Microsoft Community, that I didn't had SilverLight installed.
After installing by Mihail's link (item 1) it worked fine!

Problem displaying Icon in a button in windows xp(SP2) (MFC)!

I had a problem in displaying icon in button along with the Text in MFC application.. after reading lot of arctilces I got a solution for that and it worked great.But when I tested my application in win xp(SP2)..it suprised me by not showing the icon..Check the below code which i used to display the icon along with a test in button..Please let me know if there are any fix for this issue..waiting for your replies
HICON addIcon = (HICON)LoadImage(AfxGetApp()->m_hInstance,MAKEINTRESOURCE(IDI_ICON4),
IMAGE_ICON,0,0,LR_DEFAULTCOLOR);
SendMessageA(::GetDlgItem(m_hWnd,IDC_ADD),BM_SETIMAGE,IMAGE_ICON,(LPARAM)(DWORD)addIcon);
If you're using VS2008 (you should), use CMFCButton from the Feature Pack. It has much better support for bitmapped buttons.
I can confirm that i can't get it to work (on Win2003, my primary development machine) and a brief search on the web found many complaints but no viable answers.
My only suggestion would be to do an ownerdraw button - handling the WM_DRAWITEM message is not difficult and may resolve this issue for you across the board.
see "Native Win32 Theme aware Owner-draw Controls without MFC"

VBA editor auto-deletes spaces at the ends of lines

Is there a way to convince the VBA editor in Excel to stop auto-formatting lines to remove the space at the end when I pause in my typing for a quarter second?
I had this exact problem and the following worked for me.
Click the Microsoft Office Button, and then click Excel Options
Click the Add-Ins category
In the Manage box, click COM Add-ins, and then click Go.
Look for an add in called 'Load Test Report AddIn' then uncheck it
restart excel
This addin is installed with VS2010 Beta2
In Excel 2010, toggling Design Mode button on the Developer Ribbon Tab solves the problem for me.
I've definitely had that issue before, where the vba editor would format as I was typing (not just when I went to another line). For me, it seemed to be related to a Microsoft Web Browser control that I had in an open workbook. When I took out the web browser, the VBA editor started acting normally again. I have no idea why that worked, but it did. Now I avoid using that control in my workbooks.
Something is causing your spreadsheet to recalculate while you are in the VBA Editor and this 'compiles' your code and thus strips the spaces. You need to stop the cells recalculating while you are editing. Turning the calculation to manual in the spreadsheet.
Tools > Options > Calculation should do the trick.
I noticed this when I had cells recalculating thanks to a DDE connection.
There is sort of a way to turn off the auto-"correction" in the VBA Editor.
Tools Menu -> Options -> Editor Tab -> Clear the Auto Syntax Check box
Sadly, this won't solve all your problems, as the VBA Editor tends to have a mind of its own, for better or worse.
Taking it out of design mode fixes it every-time on vba2003 - its was driving me crazy at first ... i did notice it might have something to do with the web control but when i take it out of design mode it works fine ... just toggle that to get it to behave :)
I have had this same problem several times recently, and has driven me crazy.
After reading this post all the different fix-ups mentioned (none worked for me), I recalled I have been playing lately with Internet Explorer Control, opening Internet Explorer from VBA.
This is mentioned in some of the answers in this post.
This got me in the right path and, in order to fix it, I had to first delete all iexplore.exe instances (alt+control+delete), closed Excel and open excel again.
(iexplore.exe had been opened invisible from the VBA code, and I didn't know they were running)
That fixed the bug.
I have been programming quite heavily with VBA for over 4 years, and never had this problem.
Just a couple of weeks ago I started using IE control, and I started getting this problem...so in my case I can only assume the bug is directly related to the IE control.
I am running both excel 2003 and 2007 in same PC at the same time, and the problem only happens with excel 2007.
None of the above for me.
I had a Application.OnTime timer that fired every second and this triggered a recalculation of something: commenting it made my day.
This has started happening to me recently after adding a Timer event to an Access 2007 form. The VB editor "finalizes" the current line (as if you had moved the cursor off of the statement; I have auto syntax checking off) each time the event fires (initially I had it set to 1 second, now it is set to 5 seconds, and the behavior scales accordingly). In order for the event code to execute, the application has to ensure that it has been compiled. Presumably, the editor needs to be in a "sane" state to do this, as it probably has to check for code dependencies among modules. Note that the behavior occurs regardless of whether any dependent code is actually loaded into the editor at the time. Note also that resetting the execution state doesn't affect the timer event firing. As a practical matter, one could close the triggering form, switch it to design view, set a breakpoint in the triggered code, or increase the timer interval while working with the editor.
In contrast to abhishek's comment, changing the settings of Tools/Options.../General/Compile On Demand and/or Background Compile did not affect the issue.
If it helps, none of the previous answers solved mine. Only solution appeared to be to close the xls file and reopen it. Frustrating to have to do every 30 mins but at least it works. Would love to know why it's recompiling and cleaning the text... should really be an option to disable the text cleanup but couldn't find it.
Turn off Tools > Options > General > Background Compile. This solved it for me.
This is a long standing problem that could have various causes. I had this same issue occur in the Access VBE (so naturally the Excel answers weren't relevant). After a LOT of digging I finally got it fixed with the solution below. First a recap though:
If you are here because of this issue in Excel, try the solutions above first. To summarize:
The most common issue in Excel is that the Design button is toggled. Toggle that and see if the behavior changes as submitted by Dmitry Frenkel above
If that doesn't work, check for the "Load Test Report" AddIn as mentioned by Ade.
Those are really the two main causes in Excel, but if neither of those solutions work, then scroll through the rest of the solutions here. All are valid possibilities for the cause. In Access the cause is pretty straight forward. It's a timer issue on a form somewhere. I found this solution from here by User Kevin K. Sullivan.
Copy the following line of code onto the clipboard. (You might need to
paste it into a text editor first and coerce it onto one line, depending on
your newsreader. It must be one line.)
For i = 0 to Forms.Count -1: Debug.Print Forms(i).Name, Forms(i).TimerInterval: Next i
Switch to Access.
Press Ctrl-G to go to the Immediate Window.
Press Ctrl-V to paste in the code.
Press enter to to run the code. All open forms will be listed. Any non-zero timer intervals are your culprits. Simply close that form (It may be invisibly open from another process than the one you thought you were dealing with).
I think the solution for Access here is what the user Dom was trying to say above. I guess the down votes were because it wasn't explained very well and/or because he was speaking of Access when the OG issue was in Excel. Regardless, he is likely on point if you are here because of the VBE in Access.
I hope this helps people. I know I kept finding this page when researching this issue, so that's why I thought I'd update this solution here.
I hit this problem today on a fresh install of Excel 2010 Beta 2. None of the above made any difference, but going into the trust center and disabling all application add-ins fixed the problem for me.
I have Office 2010 Pro and I had the same issue. As I type the space between each word was being deleted. After trying each of the options turning them on and off the only way I found working was to disable the Winzip Courie(excel) add-in. This is done thru the Options dialog box Add-Ins section.
In office 365 I had the same issue - what worked for me is I saved the file with a different name and when I re-opened the new file the problem went away.
I found this issue pops up when I had AutoSave on. Turning that off let me code without it compiling every second.
I don't think I've ever seen the VBE remove a space when I've stopped typing. It will remove trailling spaces from lines if you move to another line, but that's something different and not behaviour that I think can be altered.
The removal of spaces in the VBA editor for Access occurs when a form is open in Form("Execute") mode. This is probably due to background executions based on "On Timer" methods. Close the form in Access solves the problem in VBA.

Office 2007 Ribbon Programming How-to

I'm interested on how to get the old menus back for Office 2007. I know you can buy add-ins that do this, but I'm more interested on how these are done? I want to implement this at home and just need to be pointed in the correct direction!
Thanks!
These programs don't actually restore the old menu system, they modify the current Ribbon and then write the code to mock the old design.
This is where you need to start in order to modify the Ribbon.
http://msdn.microsoft.com/en-us/library/aa942866%28VS.80%29.aspx
I doubt the Ribbon is going to go away, so you probably will be better off taking the time to get used to it. I have, and now I much prefer this style menu system. In fact, I have been looking at code to implement this style in applications that I build.

Resources