Is Microsoft removing VBA from Excel?
The Office 2023 release cycle is going to be a long one.
A lot of people think it's already started and I'm not going to tell you otherwise. With that being said, I was recently working on a project where a simple VBA macro was used to perform some text replacement in a cell, and it was removed from the Excel application. I did my due diligence and searched for clues as to why, and it turns out that it's not because of the new feature pack release of Excel 2023.
In the course of my research, I came across this post from Paul Thurrott, which makes some valid points, but I didn't find the answer I was looking for. To answer my own question, I decided to test my hypothesis using a different method. When the same macro was tested with the new 2023 feature pack, it still worked as expected. Since the macro worked, the only reason that it would have been removed from the Excel 2023 application was if Microsoft were planning on removing the ability to use macros from Excel, which I doubt.
So, I decided to test a similar macro using the Windows Scripting Host (WSH). Since the WSH is a native component, it should still work, right? As expected, the script was able to run. However, this time it was a blank cell. No error message, no popup, nothing. The only thing that I was able to do is close the window. So, that tells me that the change in Excel 2023 was indeed a bug and not intentional.
The reason I think that it's a bug is because I could perform the same script without any problem using VBA in Excel 2023 and earlier. I'm not sure why they would remove functionality that works, but I suspect that it has something to do with the fact that Windows Script Host (WSH) is not available on Windows 8.
Since the WSH is a native component, I'm guessing that it will be made available for Windows 8. I'd imagine that there are other reasons that they're removing the ability to run macros.
Now, as far as I know, Microsoft has no plans to remove VBA from Excel. I also don't know why this was removed.
How do I open Microsoft Edge in Excel VBA?
One problem I encountered while writing an Excel VBA Sub is the inability of Excel to open the Microsoft Edge web browser automatically upon pressing a key combination to initiate program execution.
Therefore I decided to write a sub that would open Microsoft Edge in a tab. The sub can be run manually from VBA, however what I want is that it to trigger by pressing a key combination (ctrl, alt, shift) on Windows and Mac OS as well. I have written the following vba and it was compiled successfully but unfortunately when using "c = objSel.Value" in the For Each.Next loop at the end of sub, its not working. And yes I have tested for values being assigned within the loop and everything else seems to be working as intended.
Sub opedge(). ' This Macro will: ' 1. Initiate Microsoft Edge and open it in a new tab.
' 2. Wait for user input.
Dim objHWND As Long. Dim c. Dim ieApp As Object. Dim cSel As Object. Dim oShell As Object. Dim objTxtSel As Object. Dim objTxtArea As Object. On Error Resume Next. Set oShell = GetObject("winmgmts:.rootCIMV2") ' Get HWND for desktop window for IE11. Set ieApp = CreateObject("InternetExplorer.Application") ieApp.Visible = True ieApp.navigate "www.microsoft.com"
' Wait until IE11 completes loading. Do While ieApp.Busy DoEvents. Loop. ' Wait for user input. ' Set IE and select URL from combo box. Set cSel = ieApp.document.getElementByID("d")
With cSel.Value = c .Size = 10 .Maximize End With. OShell.EnableGloballyAccessibleApps = True
Does Excel VBA work with edge?
I would like to do some basic mathematical operations on a column that is in edge format and the results have to be written into another column. Can this be done using VBA? Thanks. Paddy. Answer Wiki.e. There are two ways to approach this problem. The first is to use the Format() function to convert the cell data into the proper format for your calculations. The second is to use VBA, and there are a number of ways to accomplish this. For a simple solution to both these problems, see my solution here:
This is the simplest way to perform the calculation, you should not need to access the edge format. However, if you do need to access the format, you can do so like so: Format(Cell.Value) Alternatively, you can do a bit of calculation and use a formula to convert the results. You could use the following formula: =SUM(D2:D4). You can even use conditional formatting to automatically highlight any cells which are greater than or equal to 3 and less than or equal to 4, which will give you the sum of cells 2 and 4. I've been playing around with this idea for a little while now. You might want to look at a version of this thread in the VBA forums that I found. Here's a link to it:
I didn't see this topic in the archives. I've been using this code for a few years. It seems to work perfectly:
Sub Test(). Dim r As Range. Dim Num As Long. Num = 0. For Each r In Sheet1.
Related Answers
Does Excel 2016 have Macros?
After I used the Microsoft Office Assistant tool to clean up my Excel spreads...
What language do Excel macros use?
It really depends on what you're doing. If you're writi...
How can I open a PDF file in Excel for free?
How to Convert PDF to Excel for Free. Convert PDF to Exce...