-
WSpeterguk
AskWoody LoungerHi Andrew
Yes, i have set a reference to Excel, in fact, this bit of code is in the same procedure as the other code you refer to.
In addition, when i step through the code, the cursor indicates the correct row number when held over rng.row, so that bit is working, and furthermore, if the row number is such that it should be skipped, it is skipped, so the Mod line is definately OK.
-
WSpeterguk
AskWoody LoungerHi Rory
Yes, i am running this code from within Access. Am i correct in saying i will always need to use the bit before the dot (sorry about the technical reference
)whilst referencing Excel (or any other Office app. whilst in Access?
Anything else i should look out for???
Thank you for your contribution.
-
WSpeterguk
AskWoody LoungerWell, i’ve solved it!!
After loads of reading about automation and looking at dozens of irrelevant examples i tried changing:
Dim r as range
to:
Dim r as Excel.Range
and hey presto!
What i’d like to know is why i have to put this and you don’t????
-
WSpeterguk
AskWoody LoungerHi Jon.
Thanks once again for your help. I’m getting there slowly, and although i am experienced in Access VBA, I am quite new to Excel programming. In fact, i’ve even been out this morning and bought MS’s Excel VBA book to give me a start.
OK, to my problem. I’m now able to create the new blank column, but i’m getting a “Method or Data Member not found” error message on the “row” bit of this line:
Cells(r.row, 1) = r.row
I know from Access programming that you’re usually going OK if you use one of the choices offered in the box that comes up after typing the dot, but in this case “row” is not offered.
Have i got something wrong???
-
WSpeterguk
AskWoody LoungerThanks for your comments Andrew.
Not sure if i made myself clear, but what i want to do from within my import code in Access is add a new column to the worksheet and update each row with a unique number, i.e. the equivelant of autonumbering a table in Access.
-
WSpeterguk
AskWoody LoungerThanks Jon for your prompt reply. I’ve been looking all morning for a module in an old database that had the code i’m looking for, but it continues to elude me.
Can you tell me how i create a field in the worksheet please?
Cheers
-
WSpeterguk
AskWoody LoungerHey, that’s perfect!!!!
Thank you very much for your assistance.
I guess i need to go away and learn all there is to know about bookmarks…..
Peter
-
WSpeterguk
AskWoody LoungerHi
I’ve been trying to do that, but without much success. Here’s my code:
Dim dbs As DATABASE, rst As Recordset
Set dbs = Currentdb
Set rst = Me.RecordsetCloneWith rst
If rst.EOF ThenExit Sub
Else
MsgBox (“OK Message”)
docmd.GoToRecord , , acNext
End If
End With
If i run this under the “Next record” button, i still get my test message and “End of recordset” message. Any ideas where i am going wrong??
-
WSpeterguk
AskWoody LoungerHi. This subject interests me too. I have three databases which run reports automatically at night. I have built a forth database which backs up and compacts the other three, but of course, this can’t be done if the databases are open. What i have mananaged to do is run macros within the three from the forth using run msaccess.exe /db name etc (actual code on request), but i am sure it must be possible to run code remotely by creating a workspace??? I agree, running macros is not at all nice compared to running code, which is why i would love to get this sorted out.
At the moment i have to leave all four open, and then rely on a whole bunch of timers to run reports and close each app. down before the timer on the compactor kicks in, but i really would like to be able to “control” each of the three from the fouth.
-
WSpeterguk
AskWoody LoungerRory. That’s great thank you. I can see now that my code was running in it’s entirety on the timer event, and not one loop at a time. Great!
-
WSpeterguk
AskWoody LoungerHi. Thank you for your prompt reply. Unfortunately this database is run from a server location as my company will not allow the logon scripts to be modified in terms of updating the front end……
-
WSpeterguk
AskWoody LoungerMary, you’re a star! Thanks very much. I knew there was a good reason for keeping that Office 95 disc!
Many thanks again for your efforts.
-
WSpeterguk
AskWoody LoungerThanks for your reply Mary.
Yes, both they and I have access to both Win95 and Win98. Are the files i need to find easy, or will it be a case of “missing dll” errors for ever
???
-
WSpeterguk
AskWoody LoungerThanks for your reply. Sounds hopeful! Apologies for my ignorance, but where do i find these settings?
-
WSpeterguk
AskWoody LoungerOK, sorted it. Put the End If before the mytable.movenext. Good Grief! Thanks for your help. My application is now one bit more idiot proof
![]() |
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
6 hours, 44 minutes ago -
Ascension says recent data breach affects over 430,000 patients
by
Nibbled To Death By Ducks
13 hours, 50 minutes ago -
Nintendo Switch 2 has a remote killing switch
by
Alex5723
1 hour, 15 minutes ago -
Blocking Search (on task bar) from going to web
by
HenryW
7 hours, 25 minutes ago -
Windows 10: Microsoft 365 Apps will be supported up to Oct. 10 2028
by
Alex5723
23 hours, 58 minutes ago -
Add or Remove “Ask Copilot” Context Menu in Windows 11 and 10
by
Alex5723
1 day ago -
regarding april update and may update
by
heybengbeng
1 day, 1 hour ago -
MS Passkey
by
pmruzicka
3 hours, 30 minutes ago -
Can’t make Opera my default browser
by
bmeacham
1 day, 9 hours ago -
*Some settings are managed by your organization
by
rlowe44
19 hours, 58 minutes ago -
Formatting of “Forward”ed e-mails
by
Scott Mills
1 day, 8 hours ago -
SmartSwitch PC Updates will only be supported through the MS Store Going Forward
by
PL1
2 days, 3 hours ago -
CISA warns of hackers targeting critical oil infrastructure
by
Nibbled To Death By Ducks
2 days, 12 hours ago -
AI slop
by
Susan Bradley
6 hours, 46 minutes ago -
Chrome : Using AI with Enhanced Protection mode
by
Alex5723
2 days, 14 hours ago -
Two blank icons
by
CR2
1 day, 1 hour ago -
Documents, Pictures, Desktop on OneDrive in Windows 11
by
ThePhoenix
16 minutes ago -
End of 10
by
Alex5723
3 days, 1 hour ago -
Single account cannot access printer’s automatic duplex functionality
by
Bruce
1 day, 23 hours ago -
test post
by
gtd12345
3 days, 7 hours ago -
Privacy and the Real ID
by
Susan Bradley
2 days, 21 hours ago -
MS-DEFCON 2: Deferring that upgrade
by
Susan Bradley
1 day ago -
Cant log on to oldergeeks.Com
by
WSJonharnew
3 days, 12 hours ago -
Upgrading from Win 10
by
WSjcgc50
1 day, 23 hours ago -
USB webcam / microphone missing after KB5050009 update
by
WSlloydkuhnle
2 days, 3 hours ago -
TeleMessage, a modified Signal clone used by US government has been hacked
by
Alex5723
4 days, 3 hours ago -
The story of Windows Longhorn
by
Cybertooth
3 days, 15 hours ago -
Red x next to folder on OneDrive iPadOS
by
dmt_3904
4 days, 5 hours ago -
Are manuals extinct?
by
Susan Bradley
1 day, 6 hours ago -
Canonical ditching Sudo for Rust Sudo -rs starting with Ubuntu
by
Alex5723
4 days, 14 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.