If the sheet name includes some non alphabetical characters you have to set it in square bracket [ ]; better set it always in brackets
Set rs = db.openrecordset("select * from [" & ActiveSheet.Name & "];")
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
Why is there error
due to this line
Set rs = db.openrecordset("select * from " & ActiveSheet.Name & ";")
while ActiveSheet.Name is having value like "Week8-13"?
Set rs = db.openrecordset("select * from [" & ActiveSheet.Name & "];")
Sorry, II still have same error using line below
Set rs = db.openrecordset("select * from [" & ActiveSheet.Name & "];")
Viorel,
Excel code to retrieve Access data.
FYI (DB file and Excel file)
https://1drv.ms/x/s!Ai8CrEskdewXvwPP8sr_QRAuLLeQ?e=kzGS5q
https://1drv.ms/u/s!Ai8CrEskdewXvwJry99MPfM5CUy0?e=fiERBZ
Does your Access database include a table, which is called “Week8-13”?
Yes
This thread may be related to this other one.