By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,474 Members | 939 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,474 IT Pros & Developers. It's quick & easy.

Import Excel .XLS file (Access 2003)?

P: n/a
PW
Does the worksheet have to be exported to a CSV file first or can
Access import directly from an Excel workbook (.xls)?

Thanks,

-paulw
Jun 27 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On May 15, 3:45*pm, PW <paulremove_williamson...@removehotmail.com>
wrote:
Does the worksheet have to be exported to a CSV file first or can
Access import directly from an Excel workbook (.xls)?

Thanks,

-paulw
access with handle either based on how you create the link table
Jun 27 '08 #2

P: n/a
PW
On Thu, 15 May 2008 18:19:30 -0700 (PDT), Roger
<le*********@natpro.comwrote:
>On May 15, 3:45*pm, PW <paulremove_williamson...@removehotmail.com>
wrote:
>Does the worksheet have to be exported to a CSV file first or can
Access import directly from an Excel workbook (.xls)?

Thanks,

-paulw

access with handle either based on how you create the link table
Would you explain "create the link table" further"? Your response to
my previous post:
>create a linked table to your excel worksheet
then use an insert query to populate your table
<

I did not know a link could be pointed to an Excel file. I do not
know the name of the file until the user selects it in a dialog box
like so:

strFilter = ahtAddFilterItem(strFilter, "Comma Seperated Value Files
(*.csv)", "*.CSV")

strReturnVal = ahtCommonFileOpenSave(Filter:=strFilter, _
OpenFile:=True, _
DialogTitle:="Please select the document...", _
Flags:=ahtOFN_HIDEREADONLY)

How would I then link to that file in code?

Thanks!

-pw
Jun 27 '08 #3

P: n/a
On May 15, 8:16*pm, PW <paulremove_williamson...@removehotmail.com>
wrote:
On Thu, 15 May 2008 18:19:30 -0700 (PDT), Roger

<lesperan...@natpro.comwrote:
On May 15, 3:45*pm, PW <paulremove_williamson...@removehotmail.com>
wrote:
Does the worksheet have to be exported to a CSV file first or can
Access import directly from an Excel workbook (.xls)?
Thanks,
-paulw
access with handle either based on how you create the link table

Would you explain "create the link table" further"? *Your response to
my previous post:
create a linked table to your excel worksheet

then use an insert query to populate your table
<

I did not know a link could be pointed to an Excel file. *I do not
know the name of the file until the user selects it in a dialog box
like so:

strFilter = ahtAddFilterItem(strFilter, "Comma Seperated Value Files
(*.csv)", "*.CSV")

strReturnVal = ahtCommonFileOpenSave(Filter:=strFilter, _
OpenFile:=True, _
DialogTitle:="Please select the document...", _
Flags:=ahtOFN_HIDEREADONLY)

How would I then link to that file in code?

Thanks!

-pw
create a linked table to an existing csv file, called tblCsv
then use the code below

I used an xls file, so your connect string may be different, use this
in a debug window to get the correct string
?currentdb.TableDefs("tblCSV").Connect

Dim db As DAO.Database
Dim tbl As DAO.TableDef

Set db = CurrentDb
Set tbl = db.TableDefs("tblCSV")
With tbl
.Connect = "Excel 5.0;HDR=YES;IMEX=2;DATABASE=" & strReturnVal
.RefreshLink
End With
End Sub
Jun 27 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.