Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 361
  • Last Modified:

Access VBA

Hello,

Access Possibility
Grab a table data (myTable101) and spit that out sheet1 of C:\RR\myExcelFile.xlsx
Is that possible?


Can someone assist?

thanks
0
Rayne
Asked:
Rayne
  • 4
  • 2
  • 2
  • +1
2 Solutions
 
RayneAuthor Commented:
a veyr good vba to do this, thank you
0
 
RayneAuthor Commented:
Button on access that will call the macro – which will grab the data from the access table and then spit it out on excel file, stored somewhere…
0
 
Dale FyeCommented:
Have you looked at the help on:

Docmd.TransferSpreadsheet
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
MSmaxImplementation ConsultantCommented:
Well you don't need any code for that.

You can simply import the table (or query) directly to Excel file and refresh the table whenever you need it.

VBA is also the option (let me know from where you want to run it Access or Excel).

Let me know what version of the Excel and Access do you have so I can assist you further.

Regards,

MSMax
0
 
RayneAuthor Commented:
Hello MsMax

VBA is also the option (let me know from where you want to run it Access or Excel).
------- I would want to run the macro from within Access (preferably a form button)  - which opens up a specific excel file and  dumps the access table data

Let me know what version of the Excel and Access do you have so I can assist you further.
-----Excel 2010, Access 2010
0
 
Dale FyeCommented:
As I posted above, have you looked at the Help topic for the TransferSpreadsheet method?
0
 
MSmaxImplementation ConsultantCommented:
Please use something like that with on Click Event:


Private Sub Command0_Click()
On Error GoTo Err_Command0_Click


DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, _
    "TableNameorQueryName", "C:\WorkbookName.xls"

Exit_Command0_Click:
    Exit Sub

Err_Command0_Click:
    MsgBox Err.Description
    Resume Exit_Command0_Click
    
End Sub

Open in new window

0
 
RayneAuthor Commented:
thanks
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now