-
WSchuckrau
AskWoody LoungerObviously. No errors now, but after inserting a new worksheet called “Test” and steping through the procedure it reads the IF statement as False so no message.
-
WSchuckrau
AskWoody LoungerI have tried each and I get “Object variable or With block Variable not set.
Public Function ConvertFiles()
Dim RS As DAO.Recordset, DB As DAO.Database
Dim strFileName As String
Dim xlObj As Object
Dim xlWbk As Object
Dim xlWsh As ObjectSet DB = CurrentDb()
Set RS = DB.OpenRecordset(“tblFileNames”)
Set xlWsh = xlWbk.Sheets(1)
‘On Error Resume Next
RS.MoveFirst
Do Until RS.EOF
strFileName = RS(“Folder”) & “” & RS(“FileName”)
Set xlObj = CreateObject(“Excel.Application”)
xlObj.DisplayAlerts = False
Set xlWbk = xlObj.Workbooks.Open(strFileName)
If xlWsh Is Nothing Then
MsgBox strFileName & ” ” & “has no Data”
xlWbk.SaveAs FileName:= _
strFileName, FileFormat:=-4143
End If
RS.MoveNext
xlWbk.Close SaveChanges:=True
Set xlWbk = Nothing
xlObj.Quit
Set xlObj = Nothing
Loop
RS.Close
End Function -
WSchuckrau
AskWoody Loungerrory, I guess you answered that question.
-
WSchuckrau
AskWoody LoungerDo you mean the sheet is not named sheet1? That would be true. I now have hundreds of these spreadsheets to process and each user creatively names there first sheet in their workbook. I’m working on the code you gave me.
-
WSchuckrau
AskWoody LoungerTried them both and get a “Script out of range” error.
-
WSchuckrau
AskWoody LoungerRecently one of the spreadsheets I had to process had the data in sheet2 rather than sheet1 so my process did not pull any data. I thought I could modify this conversion function to include checking cell A1 for null with an IF statement. How do I refer to the open workbook? My code gives an error “Object doesn’t support this property or method” at the IF statement line.
Public Function ConvertFiles()
Dim RS As DAO.Recordset, DB As DAO.Database
Dim strFileName As String
Dim xlObj As Object
Dim xlWbk As Object
Set DB = CurrentDb()
Set RS = DB.OpenRecordset(“tblFileNames”)
‘On Error Resume Next
RS.MoveFirst
Do Until RS.EOF
strFileName = RS(“Folder”) & “” & RS(“FileName”)
Set xlObj = CreateObject(“Excel.Application”)
xlObj.DisplayAlerts = False
Set xlWbk = xlObj.Workbooks.Open(strFileName)
If IsNull(xlWbk!Sheet1.A1) Then
MsgBox strFileName & ” ” & “has no Data”
xlWbk.SaveAs FileName:= _
strFileName, FileFormat:=-4143
End If
RS.MoveNext
xlWbk.Close SaveChanges:=True
Set xlWbk = Nothing
xlObj.Quit
Set xlObj = Nothing
Loop
RS.Close
End Function -
WSchuckrau
AskWoody LoungerSteve,
As I was thinking of questions the links you gave me answered them all. I love this forum. Thanks so much.
-
WSchuckrau
AskWoody LoungerI applied MarkJ’s tip. Really made a big difference in size on several databases.
Thanks -
WSchuckrau
AskWoody LoungerHans, I am sorry I couldn’t explain myself better. I was able to work out the issues so I know you would have had you understood what my problem was. The idea came to me as I was walking home last night.
-
WSchuckrau
AskWoody LoungerI found it in the help file…daaa.
-
WSchuckrau
AskWoody LoungerWhen I experienced this I was able to correct it by setting the sharing level to ‘edited record’.
-
WSchuckrau
AskWoody LoungerWhy not use an update query with the update to as Null, no quotes, and the criteria as 0.
-
WSchuckrau
AskWoody LoungerWorks like a charm…as always. Thanks.
-
WSchuckrau
AskWoody LoungerThank you. I really missed you guys while your site was down.
I have noticed when I use the NZ function I cannot format Currency. Is there a way around this?
-
WSchuckrau
AskWoody Lounger“12-34-567-8912345.JOHN DOE” .”MARY SMITH.MIKE JONES” .
7FF6FF6FFF6FFFFFFF*0*DDCD4CDC74*0*7DCDE4EDCEC*0*DCDC4DDDCE74*0*4444444444444444444444444
F12034056708912345*A*1 6 85 046 5 F0*5*F419 8 024 9 38 *A*4 92 5 0165 5 2 F0*5*0000000000000000000000000This is the HEX view of a string to show where the 0A and 05 characters are placed. I’ve added spaces to make the second and third lines line up as they are read vertically. The * is just to identify the characters. When opened in Excel the Z with the inverted caret shows up between 5 and John Doe, and between H and Mike Jones. Sorry I’m doing such a poor job communicating this. If this still makes no sense just let it go. Thanks for your time.
![]() |
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
-
Seeing BSOD’s on 24H2?
by
Susan Bradley
55 minutes ago -
TUT For Private Llama LLM, Local Installation and Isolated from the Internet.
by
bbearren
4 hours, 21 minutes ago -
Upgrade from Windows 10 to 11
by
Holdsworth8
6 hours, 45 minutes ago -
Microsoft : AI-powered deception: Emerging fraud threats and countermeasures
by
Alex5723
9 hours, 35 minutes ago -
0patch
by
WSjcgc50
6 hours, 3 minutes ago -
Devices might encounter blue screen exception with the recent Windows updates
by
Susan Bradley
2 hours, 57 minutes ago -
Windows 11 Insider Preview Build 22631.5261 (23H2) released to Release Preview
by
joep517
12 hours, 34 minutes ago -
Problem opening image attachments
by
RobertG
14 hours, 9 minutes ago -
advice for setting up a new windows computer
by
routtco1001
1 day, 4 hours ago -
It’s Identity Theft Day!
by
Susan Bradley
9 hours, 11 minutes ago -
Android 15 require minimum 32GB of storage
by
Alex5723
1 day, 9 hours ago -
Mac Mini 2018, iPhone 6s 2015 Are Now Vintage
by
Alex5723
1 day, 9 hours ago -
Hertz says hackers stole customer credit card and driver’s license data
by
Alex5723
1 day, 10 hours ago -
Firefox became sluggish
by
Rick Corbett
1 day, 7 hours ago -
Windows 10 Build 19045.5794 (22H2) to Release Preview Channel
by
joep517
1 day, 14 hours ago -
Windows 11 Insider Preview Build 22635.5235 (23H2) released to BETA
by
joep517
1 day, 14 hours ago -
A Funny Thing Happened on the Way to the Forum
by
bbearren
12 hours, 1 minute ago -
Download speeds only 0.3Mbps after 24H2 upgrade on WiFi and Ethernet
by
John
6 hours, 35 minutes ago -
T-Mobile 5G Wireless Internet
by
WSmmi16
12 hours, 42 minutes ago -
Clock missing above calendar in Windows 10
by
WSCape Sand
13 hours, 54 minutes ago -
Formula to Calculate Q1, Q2, Q3, or Q4 of the Year?
by
WSJon5
2 days, 5 hours ago -
The time has come for AI-generated art
by
Catherine Barrett
1 day, 9 hours ago -
Hackers are using two-factor authentication to infect you
by
B. Livingston
1 day, 19 hours ago -
23 and you
by
Max Stul Oppenheimer
2 days, 2 hours ago -
April’s deluge of patches
by
Susan Bradley
6 hours, 27 minutes ago -
Windows 11 Windows Updater question
by
Tex265
6 hours, 48 minutes ago -
Key, Key, my kingdom for a Key!
by
RetiredGeek
3 days, 11 hours ago -
Registry Patches for Windows 10
by
Drcard:))
3 days, 15 hours ago -
Cannot get line length to NOT wrap in Outlining in Word 365
by
CWBillow
2 days, 22 hours ago -
DDU (Display Driver Uninstaller) updates
by
Alex5723
2 days, 7 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.