Hi I do that below before Wend, though I did not paste it. I have pasted the whole code down. The issue is that, the excel sheet remains empty except the Heading. Another thing that I noticed is that if I give a specific badge_no instead of rsemployeedetails!badge_no in MySQL, access transfers...