Dim query_excel As String = "SELECT * from [" & file & "$]"
Never build an SQL query by concatenating with user inputs, it is named "SQL injection", it is dangerous for your database and error prone.
A single quote in a name and your program crash. If a user input like "Brian O'Conner" can crash your app, it is an SQL injection vulnerability.
SQL injection - Wikipedia[
^]
SQL Injection[
^]
Quote:
I got this error "'DAFTAR1$' is not a valid name.
And what is the real database name?
Are you sure it exist in your PC?