I have 30 .DBF Files to open, edit, save and then close. I have a macro that opens all 30 of the
files, edit and attemps to close, a message appears and say that the.DBF cannot be saved in the current format. To save your
changes, click OK, then save it as the latest format. The macro takes care of the first dialoug boxes.
goes to the "SAVE AS" box and there it wants a manual save the file. The file name is ok, and it wants to save it as a
*.xlsx, and that all great. My question is - is there a way to automate with a macro and to just let it say yes to save
this action with having to click on the Save button every time - which would be 30 times.
Please let me know,
Thanks and I appreciate you all help.
Dim Wb As Workbook, sFile As String, sPath As String
Dim itm As Variant
Dim strFileNames As String
sPath = "C:DataLoging"
' Retrieve the current xl files in directory
sFile = Dir("C:DataLoging" & "*.DBF")
Do While sFile ""
strFileNames = strFileNames & "," & sFile
sFile = Dir()
' Open each file found
For Each itm In Split(strFileNames, ",")
If itm "" Then
' This will cause the opened workbook to be come the active workbook
Set Wb = Workbooks.Open(sPath & itm)
If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines
This code does everything accept closes the SAVE AS dialoug box. It's not a really big deal if I have to manually
close each file, but I figure it would sure be cool if this part could be automatically done.