Transferspreadsheet filename question

StevieRayB

New member
Local time
Today, 12:54
Joined
Jan 21, 2009
Messages
6
Hi all;
I have an Excel workbook that has 2 worksheets named "decision" and "quality". I need to load these 2 worksheets to Access into 2 seperate tables named (you guessed it) "decision" and "quality".

I have a form that builds the path and filename portion of the macro to execute the "transferspreadsheet" command.

I need to know exactly how the "filename" that includes the path is supposed to look to load the "decision" worksheet into the "decision" access table and the "quality" worksheet into the "quality" access table .

The path and filename is:
g:\excelfiles\accesstransfer\daily-transfer.xls

Thank you.
 
the range to select in the docmd.transferspreadsheet needs to look like

!tabname

its the bang ! thats important

without this, it will use the first sheet in the workbook

you can use a variable, so its "!" & sheetname

--------
this range is different to the filename itself which is a separate parameter in the docmd.transferspreadsheet command
 
I'll give it a try on Monday.

Thank you!
 
Hi Gemma,
I tried, but never got it to recognize the separate spreadsheets, so I implemented plan "B" - get the requestor to simply get the data to me on individual workbooks and finish the automated load via entering the needed parameters on a form touching off a macro. Thanks for the help and advice! It makes me research and think things through. :)
 

Users who are viewing this thread

Back
Top Bottom