@SteHawk85:
Sorry... I don't exactly understand your question.
Are you inquiring about the "DoCmd.Close .... "?
The online help should hopefully answer that...
OR
Are you inquiring about the transfersheet method?
If so, I have an example that I provided in another thread...
http://bytes.com/topic/access/answer...te-access-info
Post#4; look at the code-block starting with "Sub zj_excel_query2sheet_1()" That has an example of the access to excel.
One thing to note, if you have a workbook with the same name as given in the method AND the query is the same, the new data WILL overwrite the old data. Other thing, the constant I used is "acSpreadsheetTypeExcel12Xml" that is, I beleave, for Office 2007/2010 if you need a different format check the online help for the correct constant to use.
There is a second code-block with the excel to access... read the thread before using it... that code is actually the VERY first time I've pulled data into a database using this method.
In both cases... I consider these to be crude code as there are no error traps, U.I, etc... they are merely intended to start people, hopefully :), on the right path.
... and my spell checker isn't working today, sigh. o.O
-z