Calling an existing Excell Spreadsheet from VBA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi everybody:

I'm still a novice coder, but I have an Access vba application in which I'd
like to run a macro that does a query (no problem), but then opens an
existing excell spreadsheet and exports data to it (big problem). Can I do
it? Example code on the "open and export" or a place where I can get it?

Does the excell spreadsheet have to be in the same path\directory?
Does the spreadsheet come up in foreground? If it's closed will the Access
app still be running?

I hope these questions aren't too stupid, but thanks for reading them and
possibly helping.
 
Hi everybody:

I'm still a novice coder, but I have an Access vba application in which I'd
like to run a macro that does a query (no problem), but then opens an
existing excell spreadsheet and exports data to it (big problem). Can I do
it? Example code on the "open and export" or a place where I can get it?

Does the excell spreadsheet have to be in the same path\directory?
Does the spreadsheet come up in foreground? If it's closed will the Access
app still be running?

I hope these questions aren't too stupid, but thanks for reading them and
possibly helping.

Look up the TransferSpreadsheet method in VBA help.
The path to the spreadsheet can be any path.
The spreadsheet should be CLOSED, not open.
After you transfer the data you can open the spreadsheet using:
Application.FolowHyperlink "PathToFolder\FileName.xls"
 
Back
Top