-
WSbraddy60
AskWoody LoungerHi Rory
I can’t thank you enough, worked like a dream.
PS where do you get your patience from I would like to get some
Regards
Braddy
-
WSbraddy60
AskWoody LoungerHi Rory
I have done as you said, but it still comes up with the debug
Many Thanks
Braddy
-
WSbraddy60
AskWoody LoungerHi Rory
I did make the change you suggested the full code as below
ThanksPrivate Sub Workbook_Open()
Dim strFile As String
With ThisWorkbook
strFile = “c:mybackuppo_” & LCase$(.Sheets(1).Range(“B8”).Text) & “.xls”
If LCase$(.FullName) strFile Then .SaveAs strFileEnd With
With Sheets(1).Range(“B8”)
.NumberFormat = “00000”
.Value = .Value + 1
End WithEnd Sub
-
WSbraddy60
AskWoody LoungerHi Rory
I am sorry if I am confusing you, It’s not an error as such, what happens is when I open it the first time it works fine, then when I open it a second time the number in B8 does not increase by 1, the message I get is the warning that there is already there is already a file with this name do you want to overwrite. As shown above.
I cant’ understand why B8 won’t increment on the second and subsequent runs.Hope this is clearer
Many Thanks
Braddy -
WSbraddy60
AskWoody Lounger -
WSbraddy60
AskWoody LoungerHi Rory
I’m sorry if I am missing something but isn’t this in your original code
Regards
BraddyWith Sheets(1).Range(“B8”)
-
WSbraddy60
AskWoody Lounger -
WSbraddy60
AskWoody LoungerHi Rory
It appears that the B8 Won’t increment and I get this message
Regards Braddy
-
WSbraddy60
AskWoody LoungerHi Rory
Sorry to bother you further but I need to add my code to increment B8, but I can’t get the sequence correct
Thanks
BraddyPrivate Sub Workbook_Open()
ActiveSheet.Unprotect Password:=”aab”
With Range(“B8”)
.NumberFormat = “00000”
.Value = .Value + 1
End With
Dim strFile As String
With ThisWorkbook
strFile = “c:mybackuppo_” & LCase$(.Sheets(1).Range(“B8”).Text) & “.xls”
If LCase$(.FullName) strFile Then .SaveAs strFile(this is the part highlighted
End With
End Sub -
WSbraddy60
AskWoody LoungerHi Rory
That’s great thanks, could I impose a littler further B8 is formatted with leading zeros, is it possible to for it to save as 00001
Thanks
Braddy -
WSbraddy60
AskWoody LoungerHi Rory
Thanks for the reply, when I enter the code this line shows red for error Private Sub Workbook_Open()Dim strFile As StringRegards
Braddy -
WSbraddy60
AskWoody LoungerHi Guys
Thanks for the prompt reply, this works for me
Regards
Braddy -
WSbraddy60
AskWoody LoungerHi RockE
Thanks for your observations, there was a typo, I tried to code by hand in the end I used the wizard in Dreamweaver, it seem OK now.Thanks again
Braddy -
WSbraddy60
AskWoody LoungerHi Rory
I hear what you say, only it’s not my spreadsheet it sent to me by the creator, however I may have,as you say other alternatives
Regards
Braddy -
WSbraddy60
AskWoody LoungerHi RetiredGeek
Thank you very much for your reply and information, that’s excellent.
A big thank you to all for the replies
Regards
Braddy
![]() |
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
-
TUT For Private Llama LLM, Local Installation and Isolated from the Internet.
by
bbearren
1 hour, 25 minutes ago -
Upgrade from Windows 10 to 11
by
Holdsworth8
3 hours, 49 minutes ago -
Microsoft : AI-powered deception: Emerging fraud threats and countermeasures
by
Alex5723
6 hours, 39 minutes ago -
0patch
by
WSjcgc50
3 hours, 7 minutes ago -
Devices might encounter blue screen exception with the recent Windows updates
by
Susan Bradley
1 minute ago -
Windows 11 Insider Preview Build 22631.5261 (23H2) released to Release Preview
by
joep517
9 hours, 38 minutes ago -
Problem opening image attachments
by
RobertG
11 hours, 13 minutes ago -
advice for setting up a new windows computer
by
routtco1001
1 day, 1 hour ago -
It’s Identity Theft Day!
by
Susan Bradley
6 hours, 15 minutes ago -
Android 15 require minimum 32GB of storage
by
Alex5723
1 day, 6 hours ago -
Mac Mini 2018, iPhone 6s 2015 Are Now Vintage
by
Alex5723
1 day, 6 hours ago -
Hertz says hackers stole customer credit card and driver’s license data
by
Alex5723
1 day, 7 hours ago -
Firefox became sluggish
by
Rick Corbett
1 day, 4 hours ago -
Windows 10 Build 19045.5794 (22H2) to Release Preview Channel
by
joep517
1 day, 11 hours ago -
Windows 11 Insider Preview Build 22635.5235 (23H2) released to BETA
by
joep517
1 day, 11 hours ago -
A Funny Thing Happened on the Way to the Forum
by
bbearren
9 hours, 5 minutes ago -
Download speeds only 0.3Mbps after 24H2 upgrade on WiFi and Ethernet
by
John
3 hours, 39 minutes ago -
T-Mobile 5G Wireless Internet
by
WSmmi16
9 hours, 46 minutes ago -
Clock missing above calendar in Windows 10
by
WSCape Sand
10 hours, 58 minutes ago -
Formula to Calculate Q1, Q2, Q3, or Q4 of the Year?
by
WSJon5
2 days, 2 hours ago -
The time has come for AI-generated art
by
Catherine Barrett
1 day, 6 hours ago -
Hackers are using two-factor authentication to infect you
by
B. Livingston
1 day, 16 hours ago -
23 and you
by
Max Stul Oppenheimer
1 day, 23 hours ago -
April’s deluge of patches
by
Susan Bradley
3 hours, 31 minutes ago -
Windows 11 Windows Updater question
by
Tex265
3 hours, 52 minutes ago -
Key, Key, my kingdom for a Key!
by
RetiredGeek
3 days, 8 hours ago -
Registry Patches for Windows 10
by
Drcard:))
3 days, 13 hours ago -
Cannot get line length to NOT wrap in Outlining in Word 365
by
CWBillow
2 days, 19 hours ago -
DDU (Display Driver Uninstaller) updates
by
Alex5723
2 days, 4 hours ago -
Align objects on a OneNote page
by
CWBillow
3 days, 18 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.