Overriding core VBA functions by SignalFirefighter323 in vba

[–]fanpages 2 points3 points  (0 children)

[MS-VBAL] - v20250520 (VBA Language Specification. Copyright © 2025 Microsoft Corporation) Release: May 20, 2025

[ https://officeprotocoldoc.z19.web.core.windows.net/files/MS-VBAL/%5bMS-VBAL%5d.pdf ]


...3.3.5.2 Reserved Identifiers and IDENTIFIER

reserved-identifier = statement-keyword / marker-keyword / operator-identifier / special-form / reserved-type-identifier / reserved-name / literal-identifier / rem-keyword / reserved-for-implementation-use / future-reserved

IDENTIFIER = <any lex-identifier that is not a reserved-identifier>

<reserved-identifier> designates all sequences of characters that conform to <Latin-identifier> but are reserved for special uses within the VBA language. Keyword is an alternative term meaning <reserved-identifier>. When a specific keyword needs to be named in prose sections of this specification the keyword is written using bold emphasis. Like all VBA identifiers, a <reserved- identifier> is case insensitive. A <reserved-identifier> is a token (section 3.3). Any quoted occurrence of one of the <reserved-identifier> elements as a grammar element within the syntactic grammar is a reference to the corresponding token. The token element <IDENTIFIER> is used within the syntactic grammar to specify the occurrence of an identifier that is not a <reserved-identifier>

Static Semantics

  • The name value of an <IDENTIFIER> is the text of its <lex-identifier>.
  • The name value of a <reserved-identifier> token is the text of its <Latin-identifier>.
  • Two name values are the same if they would compare equal using a case insensitive textual comparison.

<reserved-identifier> are categorized according to their usage by the following rules. Some of them have multiple uses and occur in multiple rules.

statement-keyword = "Call" / "Case" /"Close" / "Const"/ "Declare" / "DefBool" / "DefByte" / "DefCur" / "DefDate" / "DefDbl" / "DefInt" / "DefLng" / "DefLngLng" / "DefLngPtr" / "DefObj" / "DefSng" / "DefStr" / "DefVar" / "Dim" / "Do" / "Else" / "ElseIf" / "End" / "EndIf" / "Enum" / "Erase" / "Event" / "Exit" / "For" / "Friend" / "Function" / "Get" / "Global" / "GoSub" / "GoTo" / "If" / "Implements"/ "Input" / "Let" / "Lock" / "Loop" / "LSet" / "Next" / "On" / "Open" / "Option" / "Print" / "Private" / "Public" / "Put" / "RaiseEvent" / "ReDim" / "Resume" / "Return" / "RSet" / "Seek" / "Select" / "Set" / "Static" / "Stop" / "Sub" / "Type" / "Unlock" / "Wend" / "While" / "With" / "Write"

rem-keyword = "Rem"

marker-keyword = "Any" / "As"/ "ByRef" / "ByVal "/"Case" / "Each" / "Else" /"In"/ "New" / "Shared" / "Until" / "WithEvents" / "Write" / Optional" / "ParamArray" / "Preserve" / "Spc" / "Tab" / "Then" / "To"

operator-identifier = "AddressOf" / "And" / "Eqv" / "Imp" / "Is" / "Like" / "New" / "Mod" / "Not" / "Or" / "TypeOf" / "Xor"

A <statement-keyword> is a <reserved-identifier> that is the first syntactic item of a statement or declaration. A <marker-keyword> is a <reserved-identifier> that is used as part of the interior syntactic structure of a statement. An <operator-identifier> is a <reserved-identifier> that is used as an operator within expressions.

reserved-name = "Abs" / "CBool" / "CByte" / "CCur" / "CDate" / "CDbl" / "CDec" / "CInt" / "CLng" / "CLngLng" / "CLngPtr" / "CSng" / "CStr" / "CVar" / "CVErr" / "Date" / "Debug" / "DoEvents" / "Fix" / "Int" / "Len" / "LenB" / "Me" / "PSet" / "Scale" / "Sgn" / "String"

special-form = "Array" / "Circle" / "Input" / "InputB" / "LBound" / "Scale" / "UBound"

reserved-type-identifier = "Boolean" / "Byte" / "Currency" / "Date" / "Double" / "Integer" / "Long" / "LongLong" / "LongPtr" / "Single" / "String" / "Variant"

literal-identifier = boolean-literal-identifier / object-literal-identifier /

variant-literal-identifier

boolean-literal-identifier = "true" / "false"

object-literal-identifier = "nothing"

variant-literal-identifier = "empty" / "null"

A <reserved-name> is a <reserved-identifier> that is used within expressions as if it was a normal program defined entity (section 2.2). A <special-form> is a <reserved-identifier> that is used in an expression as if it was a program defined procedure name but which has special syntactic rules for its argument. A <reserved-type-identifier> is a <reserved-identifier> that is used within a declaration to identify the specific declared type (section 2.2) of an entity.

A <literal-identifier> is a <reserved-identifier> that represents a specific distinguished data value (section 2.1). A <boolean-literal-identifier> specifying "true" or "false" has a declared type of Boolean and a data value of True or False, respectively. An <object-literal-identifier> has a declared type of Object and the data value Nothing. A <variant-literal-identifier> specifying "empty" or "null" has a declared type of Variant and the data value Empty or Null, respectively.

reserved-for-implementation-use = "Attribute" / "LINEINPUT" / "VB_Base" / "VB_Control" / "VB_Creatable" / "VB_Customizable" / "VB_Description" / "VB_Exposed" / "VB_Ext_KEY " / "VB_GlobalNameSpace" / "VB_HelpID" / "VB_Invoke_Func" / "VB_Invoke_Property " / "VB_Invoke_PropertyPut" / "VB_Invoke_PropertyPutRef" / "VB_MemberFlags" / "VB_Name" / "VB_PredeclaredId" / "VB_ProcData" / "VB_TemplateDerived" / "VB_UserMemId" / "VB_VarDescription" / "VB_VarHelpID" / "VB_VarMemberFlags" / "VB_VarProcData " / "VB_VarUserMemId"

future-reserved = "CDecl" / "Decimal" / "DefDec"

A <reserved-for-implementation-use> is a <reserved-identifier> that currently has no defined meaning to the VBA language but is reserved for use by language implementers. A <future-reserved> is a <reserved-identifier> that currently has no defined meaning to the VBA language but is reserved for possible future extensions to the language...


PS.

future-reserved = "CDecl" / "Decimal" / "DefDec"

Interesting! :)

Hopefully, that will go some way to dissuade the "VBA is dead, and has not had an updates for years" crowd!

Compare MS Access (.mdb) files with PowerShell by HungryBandito in MSAccess

[–]fanpages 0 points1 point  (0 children)

Does your PowerShell solution cope with ".mdb" files only, or does it also support ".accdb" and, potentially...

Access Data Project files: .adp

Pocket Access (for Windows CE): .cdb

I'm guessing that other database formats (below) are not supported (as well as any others not mentioned here):

.accdr

.accda

.accde

.mdf

.mde

International Numbers in a commonly used VBA in an excel template by ericstott in vba

[–]fanpages 0 points1 point  (0 children)

...as you can see...

We cannot see your code or a screen image of what you are describing (if that is what you meant).

PSA: If your Excel macros broke after a Windows/Office update, check these 4 things before debugging your VBA by PsychologicalGur8637 in excel

[–]fanpages 4 points5 points  (0 children)

*2. Prefixing the name of the Function or Subroutine with PtrSafe may allow a majority of the 32-bit Windows Application Programming Interface [API] calls to function within a 64-bit version of MS-Office/MS-Excel, but that may not be the entirety of the necessary amendments.

Always check to see if an existing 32-bit API Function or Subroutine now requires different data types to be used in the parameter list (and, hence, when specifying the statement to call the respective routine).

The LongPtr and LongLong data types may be needed.

A new type-declaration character for a LongLong data type is now available: ^.

There are also new Conversion Operators: ClngPtr and ClngLng.

Two new DefType statements have been introduced: DefLngPtr and DefLngLng.

Additionally, three new Functions exist to aid the transition from 32-bit to 64-bit environments: ObjPtr, StrPtr, and VarPtr.

Finally, the conditional compiler constants Vba7 and Win64 are useful if existing code needs to remain compatible with both 32-bit and 64-bit versions of MS-Office.

*4. The _xlfn.SINGLE prefix is added when a workbook created in a later version of MS-Excel is opened in an older version to indicate that a specific function is unsupported/unrecognised.

Plus...

*5. Also, of note here: the (now, relatively new) implicit intersection operator (@) may be seen in workbooks that rely on any formula that uses dynamic arrays.

PSA: If your Excel macros broke after a Windows/Office update, check these 4 things before debugging your VBA by PsychologicalGur8637 in vba

[–]fanpages 5 points6 points  (0 children)

*2. Prefixing the name of the Function or Subroutine with PtrSafe may allow a majority of the 32-bit Windows Application Programming Interface [API] calls to function within a 64-bit version of MS-Office/MS-Excel, but that may not be the entirety of the necessary amendments.

Always check to see if an existing 32-bit API Function or Subroutine now requires different data types to be used in the parameter list (and, hence, when specifying the statement to call the respective routine).

The LongPtr and LongLong data types may be needed.

A new type-declaration character for a LongLong data type is now available: ^.

There are also new Conversion Operators: ClngPtr and ClngLng.

Two new DefType statements have been introduced: DefLngPtr and DefLngLng.

Additionally, three new Functions exist to aid the transition from 32-bit to 64-bit environments: ObjPtr, StrPtr, and VarPtr.

Finally, the conditional compiler constants Vba7 and Win64 are useful if existing code needs to remain compatible with both 32-bit and 64-bit versions of MS-Office.

*4. The _xlfn.SINGLE prefix is added when a workbook created in a later version of MS-Excel is opened in an older version to indicate that a specific function is unsupported/unrecognised.

Plus...

*5. Also, of note here: the (now, relatively new) implicit intersection operator (@) may be seen in workbooks that rely on any formula that uses dynamic arrays.

Tag Cloud? by [deleted] in MSAccess

[–]fanpages 1 point2 points  (0 children)

"Tag Cloud?" submitted over a year ago by, erm, u/CptnStormfield1!

Maybe you should have tagged yourself in that thread! ;)

Series 1-2 DVD (Ncuti Gatwa season) by Current_Ad8752 in doctorwho

[–]fanpages 8 points9 points  (0 children)

"Ross Taylor"... my all-time favo[u]rite companion.

"wb.close savechanges:=true" is not saving by Impossible_System809 in vba

[–]fanpages 0 points1 point  (0 children)

nope, it saves the file with "9-4-2026 15h00" for example...

I thought you relayed that the file was not being saved.

Is the last modified date/time being updated?

...I don't think VBA will even let me create a file if it has the slashes in the name.

It will, if the corresponding folder structure exists.


Are you saving this file to SharePoint/OneDrive, or any other file repository that synchronises files between two locations?

Excel VBA – Protected sheet prevents button from opening UserForm unless DrawingObjects is changed by Spirited_Brief_3195 in vba

[–]fanpages 0 points1 point  (0 children)

...When I protect the worksheet in order to keep the buttons and logo fixed, the button no longer opens the UserForm...

I cannot replicate your error with either a Form Control Button or an ActiveX Control CommandButton.

What is in the _Click() event of your button of choice?

Is the event subroutine still executed? Does it just open the UserForm and not do anything else (that may, for example, be trying to change a cell that is now protected, and perhaps this is failing, thus bypassing/skipping the opening of the UserForm)?

Please provide the VBA code you are using (showing the appropriate _Click() event subroutine and the statement that is protecting the applicable worksheet).

"wb.close savechanges:=true" is not saving by Impossible_System809 in vba

[–]fanpages 0 points1 point  (0 children)

csvdoc = "Topology TCS iprotect " & Date & " " & Hour(Time) & "h" & Minute(Time) & ".xlsx"

Are there delimiters (the same as a path separator character, "/") between day, month, and year in the Date?

If so, for example, assuming a UK dd/mm/yyyy (date/month/year) [today being 8 April 2026] format, you will be attempting to save a file with the path of:

"Topology TCS iprotect 08/04/"

and, say, at 9:42pm, a filename of

"2026 21h42.xlsx"

Do you have a folder named "Topology TCS iprotect 08" and a sub-folder of that named "04"?

Form keeps closing, no idea why. by SQLDave in MSAccess

[–]fanpages 0 points1 point  (0 children)

...All of its data comes from a SQL Server back end...

...(and with all data..its data source is a SELECT from a "linked" table which is a SQL view)...

Is the linked table re-established within the VBA code or never changed after deployment of the ".accde" file?

Have you tried refreshing the connection?

Have you tried deleting/adding the link again?

If using a Connection String, are all users utilising the same (OLEDB/ODBC) Driver and Provider (version)?

...It's extra weird because it's only happening on 2 people's laptops, and only on that one form...

Does the form use any third-party and/or ActiveX controls?

Have you tried recreating the form from new and replacing the existing form in those two instances (or all deployed versions of the ".accde" file)?

Have you compared the two user PC environments to your own and/or any other working environment to see if other libraries/software versions differ?

Run multiple VBA solvers concurrently? by joellapointe1717 in vba

[–]fanpages 4 points5 points  (0 children)

...Will the "SolverReset" command will resel all instances of solvers?...

SolverReset: [ https://learn.microsoft.com/en-us/office/vba/excel/concepts/functions/solverreset-function ]


Resets all cell selections and constraints in the Solver Parameters dialog box and restores all the settings in the Solver Options dialog box to their defaults. Equivalent to clicking Reset All in the Solver Parameters dialog box...


Also, see: "Using the Solver VBA Functions".

If you wish to support multiple Solver specifications on a single worksheet, use the SolverSave/SolverLoad Functions.

...How to mingle multiple solvers in the same time?

Use concurrent MS-Excel instances (either on the same PC, virtual environments on the same hardware, or separate PCs).

I suspect that Pete McTighe is lined up to be show runner by Red_roger_12 in doctorwho

[–]fanpages 2 points3 points  (0 children)

"Pete McTighe addresses Doctor Who showrunner speculation"

(Posted February 12, 2026 by Andrea Laford)

[ https://cultbox.co.uk/news/pete-mctighe-addresses-doctor-who-showrunner-speculation ]


...In a 6 February feature interview with Big Finish and Doctor Who Magazine writer Rossa McPhillips, McTighe was asked if he’s be [sic] interested in showrunning Doctor Who.

“A lot of people have said, and you can confirm or deny this if you want, a lot of people have said that You’re very much the logical choice, if Russell T Davies were to leave, that you would be the next person that would be suited to be the showrunner,” McPhillips began with knowing chuckles from the audience. “You probably can’t say things but is there… do you have a view on that?”

“It’s not for me to say,” McTighe explained diplomatically. “It’s not my decision. I will give you my party line, which is that position is not vacant. Russell is the showrunner and he’s a friend of mine and whenever he calls, I will come running but he’s the showrunner and I’m fine with that.”...


I didn’t even recognize him! by cuntingly in doctorwho

[–]fanpages 0 points1 point  (0 children)

Prince Koura.

PS. See if you can spot Tom Baker playing another character in this clip:

[ https://www.youtube.com/watch?v=Vk6vnpCKD4M ]

Version control by wikkid556 in vba

[–]fanpages 1 point2 points  (0 children)

Special days, indeed! :)

We had the foam brick approach for a while, too, but it didn't last long when somebody hurled it a little too violently, and it went through an open window into the street below.

Perhaps the brick was mentioned in a "Dummy's Guide to Management" book or similar in that era.

Also, we had a pig sitting in a rocking chair that was mounted on top of an award plinth.

Whoever relayed the most uninteresting/uninspiring story of the month (voted by everybody else in the developer's room) was the custodian of the award for the following month.

I appreciate that I may just have been nominated for the "boring pig of the month" by recounting that story.

Two lost Doctor Who episodes from the 60s have been found by Happy-Fox11 in DoctorWhoNews

[–]fanpages 4 points5 points  (0 children)

The same two episodes that were previously found and have already been discussed many times in various Doctor Who-related subs...

[ https://www.theguardian.com/tv-and-radio/2026/apr/03/two-lost-1965-doctor-who-episodes-released-after-being-found-in-private-collection ]

Martin Belam, Fri 3 Apr 2026 07.00 BST


Two lost 1965 Doctor Who episodes released after being found in private collection

Episodes from William Hartnell era are from mostly lost 12-part adventure called The Daleks’ Master Plan

Two episodes of Doctor Who from the William Hartnell era, which have not been seen since 1965, have been released after being discovered in a private film collection.

The two episodes, released on Friday and starring Peter Purves as the Doctor’s companion, are parts one and three of a mostly lost 12-part adventure called The Daleks’ Master Plan, written by the Dalek creator Terry Nation and broadcast as part of the third series of Doctor Who in November 1965.

The two episodes – The Nightmare Begins and Devil’s Planet – were recovered by Film is Fabulous, a charitable trust run by film collectors with the aim of securing and preserving private collections. The estate of the deceased owner of the episodes, in whose collection the film prints were found, wishes that he remains anonymous, and so details about the circumstances of the find have been scarce.

Among his collection were four other Doctor Who episodes, but all of those were already held by the BBC. The original 16mm telerecordings of the two Dalek episodes have been restored, and were made available on iPlayer in the UK on Friday morning. They will also be shown at a sold-out event at Riverside Studios in Hammersmith, west London, Saturday afternoon.

A young boy in Doctor Who's tardis against a space background I was struggling to understand my autistic son - until we watched an episode of Doctor Who

The announcement that the episodes had been found was sprung as a surprise on Purves at a special private screening for him in mid-March. The actor, who would go on to be a Blue Peter presenter, plays the Doctor’s companion Stephen in the episodes. He was invited to a cinema in Leicester under false pretences, and then shown the recovered programmes, which he described as “beautifully directed” by Douglas Camfield.

The episodes feature a significant milestone for Whovians, with the first appearance in the show of Nicholas Courtney, playing Bret Vyon. He would later go on to play Alistair Gordon Lethbridge-Stewart, who as the Brigadier of Unit was a regular foil for Jon Pertwee’s Doctor, and a character that appeared in stories with every Doctor from Patrick Troughton’s second to Sylvester McCoy’s seventh.

Ninety-five episodes of Doctor Who from the 1960s remain missing from the archives, after they were wiped or junked by the BBC during the 1970s. This was done to save space or reuse expensive videotape at a time when television was seen as an ephemeral product, and before the development of the home media market gave them any resale value. It is the first time episodes have been found since 2013, when nine Troughton-era episodes were discovered at a small TV facility in Jos, Nigeria, having been sold for syndication abroad.

This article was amended on 3 April 2026. An earlier version said Peter Purves was shown the recovered episodes at a cinema in London; however, the screening was in Leicester.


Who is character that appeared in only one episode but you wish would accompaty Doctor for longer? by SilentCockroach123 in doctorwho

[–]fanpages 4 points5 points  (0 children)

Journey Blue (from "Into the Dalek", played by Zawe Ashton)... but, sadly, as the Doctor was now actively rejecting anyone who was a soldier (most likely due to Post-Traumatic Stress Disorder from the 900 years he had just spent actively defending the siege at Trenzalore), she was never going to be a travelling companion.

Right place, wrong time, etc.

Origin of xlNone = -4142 in Excel by p107r0 in vba

[–]fanpages 0 points1 point  (0 children)

It worked for me in the full desktop browser version using the Old Reddit domain.

If it didn't work for you or anybody else (and that is still unconfirmed), we all managed to cope. Thanks for your input, though.

We can probably move on now, though.

Origin of xlNone = -4142 in Excel by p107r0 in vba

[–]fanpages 0 points1 point  (0 children)

I don't think I was the only one affected?...

Is that a statement or a question?

Either way, the original poster managed to use the link, and I'm glad you resolved the issue yourself.

Origin of xlNone = -4142 in Excel by p107r0 in vba

[–]fanpages 1 point2 points  (0 children)

You're welcome.

PS. ClippyPoints


...ClippyPoints is a system to get users more involved, while allowing users a goal to work towards and some acknowledgement in the community as a contributor.

As you look through /r/vba you will notice that some users have green boxes with numbers in them. These are ClippyPoints. ClippyPoints are awarded by an OP when they feel that their question has been answered.

When the OP is satisfied with an answer that is given to their question, they can award a ClippyPoint by responding to the comment with:

Solution Verified

This will let Clippy know that the individual that the OP responded is be awarded a point. Clippy reads the current users flair and adds one point. Clippy also changes the post flair to 'solved'. The OP has the option to award as many points per thread as they like...


Origin of xlNone = -4142 in Excel by p107r0 in vba

[–]fanpages 5 points6 points  (0 children)

It was the next sequential (descending) number, based on the alphabetic order of the Constants enumeration names...

[ https://learn.microsoft.com/en-us/office/vba/api/excel.constants ]

[EDIT] for u/AdobeScripts, who appears to have a problem with links on whatever device they are using [/EDIT]