Grateful for the answer.
But it didn’t work out for what I need, it was my fault that I didn’t explain better.
In the same Workook some spreadsheets are front end and others are backend (database). This is the process:
1.Enter the value in the cell (Spreadsheet-Frontend)
2.The value is copied via SQL to database (Spreadsheet-Backend)
To use SQL, I make the DAO connection:
Set db = OpenDatabase (ThisWorkbook.FullName, True, False, “Excel 8.0”)
In .xlsm it works, writes the value to the Spreadsheet-Frontend and the Database (Spreadsheet Backend).
In .exe, it does not work, it writes the value to the Spreadsheet-Frontend, where it was typed, but does not update via SQL the database (Spreadsheet-Backend).
I observed:
After processing Set db = OpenDatabase (ThisWorkbook.FullName, True, False, “Excel 8.0”), another copy of Workbook.xlsm opens and the focus of Workbook.exe is lost, so that closing Workbook.exe , it is also requested to save Workbook.xlsm, but even saving does not save the data.
Below is part of the code I use:
vValue = Target.value
Set db = OpenDatabase (ThisWorkbook.FullName, True, False, “Excel 8.0”)
bd = “bd_company $”
sql = “SELECT *”
sql = sql & “FROM” & “[” & bd & “]” & “”
Set rs = db.OpenRecordset (sql)
If rs.EOF Then
rs.AddNew
else
rs.Edit
end if
rs (“name_company”) = vValue
rs.Update
rs.Close
Please any help to finalize my project. Just missing it to finish. Thankful.