Set the cn=CreateObject (" adodb. Connection ")
Cn. The Open ". The provider=Microsoft jet. The oledb. 4.0; Extended properties=8.0 excel; Data source="& amp; ThisWorkbook. Path & amp; "\ data files \ auxiliary worksheet. XLS"
Sql="select * from [clock in formal $]"
ThisWorkbook. Sheets (1). [a1]. CopyFromRecordset cn. The Execute (Sql)
Sql="select * from [attendance detail $]"
ThisWorkbook. Sheets (2). [a1]. CopyFromRecordset cn. The Execute (Sql)
Cn. Close
End Sub
![](https://img.codepudding.com/202009/75509160927151.png)
![]( https://img.codepudding.com/202009/75509160927152.png )
![]( https://img.codepudding.com/202009/75509160927153.png )
![]( https://img.codepudding.com/202009/75509160927154.png )
CodePudding user response:
Hope ace answerCodePudding user response:
I hope this post can help you, as if the same problem with youhttp://club.excelhome.net/forum.php? Mod=viewthread& Tid=1256953 & amp; Highlight=
CodePudding user response:
Is listed as the column name with parentheses what insideCodePudding user response: