VBA open Table In Excel

rpadminserver

Board Regular
Joined
Nov 7, 2007
Messages
111
Office Version
  1. 365
Hello All..

I'm looking for VBA code that will open a specific table (data2xml) in excel.

The end result is to put this code in the on click procedure for a button.

Thanks all
Rob
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Rob, assuming that you are running this from Access, you would first need to create an Excel object, then open the file, and then use Excel's GoTo feature to target the table. How far have you got with this already? Do you need a full routine, or just a pointer for getting to the table?

Denis
 
Upvote 0
Denis... Thanks for the response.
But if I understand you correctly you are recommending that I open excel then target the table and open the table in excel. My goal is to have a button (on an access form) that will open the specific table in excel.

Thanks
R
 
Upvote 0
Rob

Is this a table in Access?

Why not just use TransferSpreadsheet or OutputTo?
 
Upvote 0
Thanks... That might be on the right track. I looked at both of those but I looks like I have to supply a destination (excel workbook) name.

This database (when finished) is going to be distributed to different users. These users are going to store their version of the database any where they want on their system

I'm looking for button that will open the table in excel and then the user, when done editing, will do a save as (in excel) and specify the location to save.

R
 
Upvote 0
Rob, looks like I misunderstood the question.
If, as Norie asked, you want to transfer an Access table to Excel, use TransferSpreadsheet. Example in this thread...

EDIT: The above shows how to push the data to a specific file. You can capture that using a file picker if the file already exists, or make the Excel spreadsheet visible and then let the user save wherever they like.

Denis
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,291
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top