-
WSAndrewKKWalker
AskWoody LoungerJanuary 23, 2020 at 1:03 pm in reply to: Application-defined or object-defined error excel from access #2089129Unfortunately that doesn’t work.
Been doing a different project, so only just got back to this.Application.Wait is not available in MS ACCESS, at least not in 365 Click to Run
So you have to call it from Excel via the Excel Object
oXL.Application.Wait (Now + TimeValue(“00:00:10”))
But for some reason you then hit the same old object lag time runtime issue as before.
Looks to me at the moment, that the only solution is to use the Inputbox Pause.
Strangely, on a local PC, this only gets triggered once.
When I ran it on a Cloud based file and database via the client, it actually triggered the need to put the same pause into the error trap.
I did add a counter in that to make sure it didn’t loop for ever.
So far, it has never needed more than 3This appears to be either a local bug, or maybe a new bug in Access.
I may dig out an old laptop running Office 2010 and see if it was an issue back then.
-
WSAndrewKKWalker
AskWoody LoungerJanuary 10, 2020 at 10:52 am in reply to: Application-defined or object-defined error excel from access #2053088Andrew,
I’ve not seen this before but it may be a timing issue.
Instead of a break point try adding this code:
Dim x As String x = InputBox(“Press any key to continue”, “Test”)
in it’s place. If the code runs after you press enter it’s a timing issue that was somehow introduced, maybe an update to excel? You can look in the Windows Update settings to see what updates were installed and when and if you find one for Excel you might try uninstalling it.
HTHGood shout!
Here’s still weird(ish) as code below
Set oxlB = oXL.Workbooks.Open(strTFolder & strTFile)
strPause = InputBox(“Workbook Opened” & vbLf & “Do you want to Proceed”, “Continue?”, “Yes”)
If strPause <> “Yes” Then
oxlb.close SaveChanges:=False
oxl.Quit
Exit SubSet oxlS = oxlB.Worksheets(“Title”)
Using the above , it executes correctly.
If I use
intPause = MsgBox(“Workbook Opened” & vbLf & “Do you want to proceed”, vbYesNo + vbQuestion + vbDefaultButton1, “Continue…”)
if intPause = vbNo
‘etcIt still fails….
I suspect MsgBox may pause all processing, whilst InputBox doesn’t.It’s a work around for now… Cheers…
I wonder why there is now a timing issue, that didn’t exist before 14th Dec?
-
WSAndrewKKWalker
AskWoody LoungerJanuary 10, 2020 at 7:53 am in reply to: Application-defined or object-defined error excel from access #2052117The issue appears to be the code fails to recognise the range object if run directly from a command button when asked to clear or change any data on any sheet.
But as I said, placing a code break before the first WITH statement, but after the workbook open line everything works fine on pressing continue.To test if the object actually exists I added some debug.print lines
placing this debug.print code before the with statement
<pre class=”bbcode_code”> ‘Open the Template
Set oxlB = oXL.Workbooks.Open(strTFolder & strTFile)
Set oxlS = oxlB.Worksheets(“Title”)
Debug.Print “oxl = ” & oXL.Name
Debug.Print “oxlB = ” & oxlB.Name
Debug.Print “oxlS = ” & oxlS.Name
For Each oxlName In oxlB.Names
If Left(oxlName.Name, 3) = “inf” Then
Debug.Print oxlName.Name & ” References: ” & oxlName.RefersTo
End If
Next
DoEvents
With oxlS
‘Clear
‘On Error Resume Next
Set oxlRC = .Range(“infClientID”)
oxlRC.ClearContents
Set oxlRC = .Range(“infClient”)
oxlRC.ClearContentsGenerates this output.
oxl = Microsoft Excel
oxlB = IPM3rdPartyExpensesSummaries117.xlsm
oxlS = Title
infAssignmentType References: =Title!$C$11
infBookMark References: =Title!$A$2
infClient References: =Title!$C$7
infClientID References: =Title!$B$7
infCurrency References: =Title!$B$9
infCurrencyName References: =Title!$C$9
infDates References: =Title!$C$8
infFor References: =Title!$C$10
infHomeCountry References: =Title!$C$13
infHostCountry References: =Title!$C$14
infReports References: =Title!$G$5
infReportSelection References: =Title!$A$3:$C$24
infServices References: =Title!$C$16:$C$38
infServicesStart References: =Title!$C$16
infSupplier References: =Title!$C$12
infUpdated References: =Title!$C$5So, it recognises the Excel Application Object, and the workbook object, and the range objects.
BUT, unless there is a breakpoint in the code, it crashes out at the line<b>oxlRC.ClearContents</b>
It appears to assign the correct Range to the Object variable <b>oxlRC</b>
It also fails if the line is changed to <b>oxlRC = “”</b>
<i>There is NO protection set on the Workbook, or Worksheets in it.</i>
And the error only appears to be when changing data, not referencing the objects.<pre class=”bbcode_code”> Set oxlRC = .Range(“infClientID”) ‘Works OK
oxlRC.ClearContents ‘Fails with the errorI even changed the code from the original to use a range object <b>oxlRC </b>, but it still comes up with the <b>Application Defined Error 50290</b>
Very very Bizarre.
-
WSAndrewKKWalker
AskWoody LoungerYep..
That’s what I meant re Advanced.A criteria Calculation that returns True or False in the second Row of Criteria that covers the necessary combined condition.
I might even play around with both ideas and see which one I like best.
But autofilter springs to mind because it means NOT needing an addition hidden extract sheet.:cheers:
-
WSAndrewKKWalker
AskWoody LoungerJune 18, 2015 at 10:55 am in reply to: More than 2 contains filters using autofilter in VBA #1510491I think I see where you are coming from Rory.
Sorry for my misunderstanding.
It had been a LOOOONNG day and I was tired.Tell me if I am wrong……
If going for AutoFilter method, which would be my preferred route
Loop through all the cells in the relevant column
and if any individual ones match the criteria
Then add the exact cell to the array, unless it is already there, so the result will be an array of all the cells I want.Makes sense now I am more awake, if that is what you were saying.
OR, for the Advanced filter solution (depending upon which route I take)
Use a formula in the criteria row, that generates either TRUE or False for that row to match the requirement.
So, in my case, I would be looking at an OR() with the contents being contains any of the required values.If my assumption is right, I agree.
Autofilter looks much simpler.I will have a re-write to accommodate that method and see where it gets me.
Thanks for feedback.
Next time I will look at messages when I haven’t been up for 19 hours :o::D -
WSAndrewKKWalker
AskWoody LoungerJune 17, 2015 at 11:45 am in reply to: More than 2 contains filters using autofilter in VBA #1510343That works with distinct values, BUT, when when there are several options all embedded needing wild cards it is the same problem I think.
Unless I have missed a bit of basic logic somewhere.If I am just going to loop through the data then I may as well write my own filter extract tool.
But advanced filter does it fine.
It is just a bit of a pain building up the filter sequences criteria for an advanced filter because IF you want A or B or C in col 1 and X or Y in column 2 you need a 6 row advanced criteriae.g
Col 1 = (A or B or C) And Col 2 = (X or Y) logic since OR logic in an advanced criteria needs a separate row so you need
Code:COL 1 Col 2 ---------------- A X B X C X A Y B Y C Y
But it isn’t that simple because they are wild card searches
so actually the advanced filter isCode:COL 1 Col 2 ---------------- *A* *X* *B* *X* *C* *X* *A* *Y* *B* *Y* *C* *Y*
Be so easy in SQL eh….
Anyway, I have done it with advanced filter now.
Easy except for compiling the criteria range.Anyone know if you can pass an array rather than a sheet range to advanced filter?
No, don’t tell me, I have done enough work today anyway.
-
WSAndrewKKWalker
AskWoody LoungerJune 17, 2015 at 11:29 am in reply to: More than 2 contains filters using autofilter in VBA #1510341Be too many fields zeddy, I would have to make them up on the fly for each field
So, if there were 10 wild card variants of 1 field I’d need an extra 4 dummy fields just for that one.
I reckon a lot easier to use an advanced filter.
Shame Microsoft put a daft 2 limit which they have never ever updated.
But then again.
It really ought to be in a database.
No matter how often you tell people that, they still want to use spreadsheets -
WSAndrewKKWalker
AskWoody LoungerJuly 10, 2014 at 2:02 pm in reply to: STOP RIGHT MOUSE Button selecting items in a MULTISELECT listbox #1459120I GUESS I WAS RIGHT!
They never considered that a requirement… :mad::( 37368-Homer-Good-Grief
-
WSAndrewKKWalker
AskWoody LoungerI would suggest something like this on an open report button
This allows for ALL or NONE of the filter components to be entered
It is a bit more long winded, but more flexible
Code:Dim strFilter as string, strThisPart as String Dim conSPM = """" 'Build Filter Components from data on the form 'I could have done it in a shorter way, but this is easier to debug 'It is always worth considering an err trap as well If Not IsNull(schoolname) Then strThisPart = " [School] = " & conSPM & schoolname & conSPM & " " 'Build Filter either this is the first bit or we need to add If strFilter = "" Then strFilter = strThisPart Else strFilter = strFilter & " AND " & strThisPart End If End If If Not IsNull(txtstartdate) Then strThisPart = " [course date] >= #" & Format(txtstartdate,"mm/dd/yyyy") & "# " If strFilter = "" Then strFilter = strThisPart Else strFilter = strFilter & " AND " & strThisPart End If End If If Not IsNull(txtenddate) Then strThisPart = " [course date] <= #" & Format(txtenddate,"mm/dd/yyyy") & "# " If strFilter = "" Then strFilter = strThisPart Else strFilter = strFilter & " AND " & strThisPart End If End If 'Now open the Report and pass it the filter If strFilter = "" Then DoCmd.OpenReport ReportName:="attended training courses" Else DoCmd.OpenReport ReportName:="attended training courses", WhereCondition:=strFilter End iF
This could have been done more quickly, but since you are new to VBA,
have a look at it and see if you can refine it. -
WSAndrewKKWalker
AskWoody LoungerJanuary 25, 2014 at 7:12 am in reply to: Access 2013 Navigation Forms On Navigation Forms buttons lose colour #1435773OK, to follow this up, with a possible solution, that is working for me anyway…
I tried a different slant on design changes, which I should have thought of at the start.
I changed the design of the second level (subform) navigation form, on it’s own.
Tested it on its own, and it worked just fineThen tested it via the top level Navigation form, and it was fine.
It appears that this may only be an issue, when you attempt to change the design of the sub navigation form, from the design screen of the main navigation form.
Maybe it will eventually get fixed, who know.
See attached image for example with working buttons.
Even when the formatting went wrong, the forms worked ok.
You just couldn’t see the text on the buttons… -
WSAndrewKKWalker
AskWoody LoungerJanuary 25, 2014 at 4:55 am in reply to: Access 2013 Navigation Forms On Navigation Forms buttons lose colour #1435765Thanks Wendell.
I had a feeling it was a bug.
I thought I might be pushing the envelope.
I will try doing a colour set on load and see if that fixed it.
If not I will just do an old school Menu Style form, and wait for Office 20??
So far the main navigation form has behaved exceptionally well. -
WSAndrewKKWalker
AskWoody LoungerJust as an additional to this already solved problem.
You could use SUMIF like thisCode:=SUMIF(DatesOfDeposits,"",ChecksReceived)
This gives the same result, unless I have misread the question.
SUMPRODUCT is a wonderful function, especially with 2 conditions or more in older versions of Excel.
But SUMIF has been optimised for the calculation whereas (and I may well be corrected on this),
SUMPRODUCT is a volatile function.
This means that it recalculates even if none of the cells effecting it are changed.On a bigger spreadsheet, this can have an impact on performance.
Feel free to shoot me down in flames on that one. :rolleyes:
-
WSAndrewKKWalker
AskWoody LoungerJune 15, 2012 at 4:24 pm in reply to: Shared database reports it is in exclusive use – Access 2003 #1336701Unfortunately the setting on the PC is not for exclusive.
I suspect it is something to do with user permissions, or maybe something on the thin client settings.
I reckon I am going to need to sit down with the Network administrator and look through the cases that show this behavior to see if we can find the cause.
If I do get to the bottom of it, I will post back here. -
WSAndrewKKWalker
AskWoody LoungerThanks.
We’ll give it a try. -
WSAndrewKKWalker
AskWoody LoungerIn case anyone is going to suggest printing it to adobe acrobat, which DOES work ok.
They do not have that.
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Where’s the cache today?
by
Up2you2
5 hours, 40 minutes ago -
Ascension says recent data breach affects over 430,000 patients
by
Nibbled To Death By Ducks
12 hours, 46 minutes ago -
Nintendo Switch 2 has a remote killing switch
by
Alex5723
11 minutes ago -
Blocking Search (on task bar) from going to web
by
HenryW
6 hours, 22 minutes ago -
Windows 10: Microsoft 365 Apps will be supported up to Oct. 10 2028
by
Alex5723
22 hours, 55 minutes ago -
Add or Remove “Ask Copilot” Context Menu in Windows 11 and 10
by
Alex5723
23 hours, 1 minute ago -
regarding april update and may update
by
heybengbeng
1 day ago -
MS Passkey
by
pmruzicka
2 hours, 27 minutes ago -
Can’t make Opera my default browser
by
bmeacham
1 day, 8 hours ago -
*Some settings are managed by your organization
by
rlowe44
18 hours, 54 minutes ago -
Formatting of “Forward”ed e-mails
by
Scott Mills
1 day, 7 hours ago -
SmartSwitch PC Updates will only be supported through the MS Store Going Forward
by
PL1
2 days, 2 hours ago -
CISA warns of hackers targeting critical oil infrastructure
by
Nibbled To Death By Ducks
2 days, 11 hours ago -
AI slop
by
Susan Bradley
5 hours, 42 minutes ago -
Chrome : Using AI with Enhanced Protection mode
by
Alex5723
2 days, 13 hours ago -
Two blank icons
by
CR2
1 day ago -
Documents, Pictures, Desktop on OneDrive in Windows 11
by
ThePhoenix
2 days, 21 hours ago -
End of 10
by
Alex5723
3 days ago -
Single account cannot access printer’s automatic duplex functionality
by
Bruce
1 day, 22 hours ago -
test post
by
gtd12345
3 days, 6 hours ago -
Privacy and the Real ID
by
Susan Bradley
2 days, 20 hours ago -
MS-DEFCON 2: Deferring that upgrade
by
Susan Bradley
23 hours, 7 minutes ago -
Cant log on to oldergeeks.Com
by
WSJonharnew
3 days, 11 hours ago -
Upgrading from Win 10
by
WSjcgc50
1 day, 22 hours ago -
USB webcam / microphone missing after KB5050009 update
by
WSlloydkuhnle
2 days, 2 hours ago -
TeleMessage, a modified Signal clone used by US government has been hacked
by
Alex5723
4 days, 2 hours ago -
The story of Windows Longhorn
by
Cybertooth
3 days, 14 hours ago -
Red x next to folder on OneDrive iPadOS
by
dmt_3904
4 days, 4 hours ago -
Are manuals extinct?
by
Susan Bradley
1 day, 5 hours ago -
Canonical ditching Sudo for Rust Sudo -rs starting with Ubuntu
by
Alex5723
4 days, 13 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.