Chose file/worksheet to open via form

  • Thread starter Thread starter King
  • Start date Start date
K

King

I want to be able to for a user to select a worksheet name from a list
box. And then click a command button and have a dialog box open for
them to select the workbook.
I found this code which would do exactly what I want to do execpt I am
not sure how to get the data in the way I want.

Any help would be appreciated.

Public Sub ImportXL()
DoCmd.TransferSpreadsheet transfertype:=acImport, _
tablename:="tmpTableName", _
FileName:="SomeExcelFile", Hasfieldnames:=True, _
Range:="'WorkSheet Name'!", SpreadsheetType:=5
'The Spreadsheet type = 5 specifies an Excel 5.0/7.0 file
'format
End Sub

Kris King
 
Sorry I didn't want to post again but I had a question. I found an
extremly useful tool provided for free called RFil - Access Report
Filtering: (See mile50.com) It is a great utility that lets you easily
filter any form. However I now want to have a total of the columns at
the bottom of my filter form. Is there any way to do this. (The form is
always in datasheet view as it is easier to read the data this way.)


Thanks for all the help everyone has given me it has made all the
difference.
 
I figured out how to chose a worksheet name. But it would still be
great if I get an open dialogue box so that they can choose the path &
name of the file (Each file should have the same name followed by
date.) I swore I saw the code for this somewhere that when you clicked
a command button you got the open dialogue box and then it filled in a
text box. If anyone knows this code or knows where I could find it that
would be great.


Thanks.
 
Back
Top