Running this code:Results in this Excel window:![]()
Please Login or Register to view this content.
excel.png
And the 'Customize Ribbon'/'Quick Access Toolbar' are deactivated in the 'Excel Options' window:
ribbon.png
Running this code:Results in this Excel window:![]()
Please Login or Register to view this content.
excel.png
And the 'Customize Ribbon'/'Quick Access Toolbar' are deactivated in the 'Excel Options' window:
ribbon.png
Are you able to click the ribbon options at all?
There's nothing to click besides Minimize, Restore and Close:
Attachment 866606
Does pressing Ctrl+Shift+F1 have any effect?
No! Do you not get the same result when running the code?
No I don't get that.
Is the ribbon there if you just create the instance, before adding the workbook?
Also, Not sure if this is necessary as a new instance won't have any workbooks.![]()
Please Login or Register to view this content.
![]()
Please Login or Register to view this content.
The application closes before I can see.Is the ribbon there if you just create the instance, before adding the workbook?
On my machine the New Application object often contain other open workbooks.
I don't think the new instance should have any workbooks and usually you have to specifically make the instance visible.
You could try late binding.
Are you making use of the personal workbook? If so you could try not doing so and see if that resolves it.![]()
Please Login or Register to view this content.
Running the code in an existing workbook, usually results in the 'New Excel.Application'/'CreateObject("Excel.Application")' object containing the workbook first time around, get new instances thereafter.
Including '.Visible = True' results in the Ribbon/Menu bar/Quick Access Toolbar showing.
I don't get a new workbook when creating a new instance and I don't think you should unless it's loading something in the Start folder or personal workbook. For me it's also invisible by default.
At least the ribbon is back though?
On my machine running this exact code:results in no Ribbon/Menu bar/Quick Access Toolbar showing, the question is, why is that.![]()
Please Login or Register to view this content.
Do you get a new workbook if you run code that includes:?![]()
Please Login or Register to view this content.
No the ribbon is not back, includingis not this exact code![]()
Please Login or Register to view this content.
![]()
Please Login or Register to view this content.
I do, but the ribbon etc is there.Do you get a new workbook if you run code that includes:
Copy to clipboard
Application.Workbooks.Add
If it run Set objApplication = New Excel.Application I get new instance which is hidden by default and contains no workbooks but has the ribbon.
I asked why this exact code:results in no Ribbon/Menu bar/Quick Access Toolbar showing.![]()
Please Login or Register to view this content.
You write:I didn't ask if one gets a new workbook when creating a new appplication object. I didn't ask if a new application object is invisible by default or not.I don't get a new workbook when creating a new instance and I don't think you should unless it's loading something in the Start folder or personal workbook. For me it's also invisible by default.
Maybe not, but it's relevant. If you use:
it should fix your issue.![]()
Please Login or Register to view this content.
Everyone who confuses correlation and causation ends up dead.
I can't replicate your issue with the ribbon or the need to retry to create a new instance without a workbook and was hopeful that your remark in post #9 concerning the visible property was indicative of some progress. I'm sorry that doesn't seem to be the case and that I don't have anything else to suggest.
I'll reference this thread in the Cavalry section: Maybe someone else will have more success.
I just wonder why the Ribbon/Menu bar/Quick Access Toolbar doesn't show when I run this exact code:There is no issue that needs fixing, I just wonder why that exact code does what it does.![]()
Please Login or Register to view this content.
I would say it's a bug. The application shouldn't be visible at all with that code, but making the window maximised seems to force it to appear, but not properly loaded. It may be that that is how it naturally works behind the scenes when it is invisible; after all, why bother with the overhead of loading the ribbon/qat etc if they can't be seen or used?
I would not expect the given VBA code to be the cause of the issue.
It is more likely the state of how Excel is installed/executed on your system.
I'm not sure about 365, but if it were older Excel I'd suggest to try checking:
+ the XLSTART folder for any .xlam, .xlsm, xlsb, xls, xla macro/addin files (or really any excel files)
+ the %appdata%\Microsoft\Templates folder for any .xlmt, xlt template files
+ or maybe even your personal QAT file found in %localappdata%\Microsoft\Office\Excel.officeUI
also maybe if it's a corporate environment try to confirm that excel is running from a local install instead of through a software virtualizer service such as citrix or app-v.
beyond that if you forced more than one excel to be installed at any given point it could be possible that the "New Excel.Application" line is pulling the wrong one from the GAL.
Last edited by Gregor y; 05-21-2024 at 05:26 PM. Reason: typo
If it'd make you feel better using my answer because of my street cred, then you can go ahead and clickAdd Reputation below to improve it.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks