That is the default name given to the first sheet in a new workbook. Any others would be named Sheet2, etc. This works:
Set ws = xl.ActiveWorkbook.Sheets("sheet1")
Or of course you can change the sheet name.
That is the default name given to the first sheet in a new workbook. Any others would be named Sheet2, etc. This works:
Set ws = xl.ActiveWorkbook.Sheets("sheet1")
Or of course you can change the sheet name.
In the attached snippet shot you can see where the code failed. I guess that it wants the db name. But it already is the
db that i am working with So what gives here.
I a confused. I put in the db name ImportExcel. i did not put in the extension or the path to it.the db is in the desktop.
Do i really have to tell it where the db is since I am already using using that same db?
Any help appreciated. Thanks i advance.
Respectfully,
Lou Reed
It expects the name of the table or query you want to pull data from, not the database. I used "table1" in your sample.
Just call it table 1? That is all?
It would seem that such a step could be hard coded in MS Access somehow?
Thanks for your help.
Respectfully,
Lou Reed
Lou, that's what YOUR table is named in the sample db you posted here. You named it that, or let a default name stand. It's not something that can be hard coded. It can be any table or query name, or SQL.
In the attached file is a zipped Access database, an Excel file and a pdf file.
I am curious as to why when I click the button on the form to export table1 to an Excel spreadsheet that it
stops on the line shown in the pdf file?
I have no stops placed in the code. Why is this happening?
It was a line that I stopped on when I was debugging the VBA code.
Any help appreciated. Thank in advance.
Respectfully,
Lou Reed
Not sure, it doesn't happen when I test. Try Debug/Clear All Breakpoints.