UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Link Access And Certain Named Range From Excel, Access 2016    
 
   
Sami
post Oct 24 2019, 03:18 AM
Post#1



Posts: 66
Joined: 3-April 19



Hi, I try to make link bettwen access and excel in by using this code:
CODE
Docmd.TransferSpreadsheet acLink,  , "MyTable", CurrentProject.Path &"\"& "MyExecelFileName" ,True,"Sheet1$"

But I couldn't use the named range from the sheet only the address of the range.
Is there any way to get the name of the range in my code?
Thanks in advance.
Go to the top of the page
 
June7
post Oct 24 2019, 03:51 AM
Post#2



Posts: 1,030
Joined: 25-January 16



If you want to use range name, don't need sheet reference.

Docmd.TransferSpreadsheet acLink, , "MyTable", CurrentProject.Path &"\"& "MyExecelFileName" ,True, "rangename"

--------------------
Attachments Manager is below the edit post window. To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
DEBUG! DEBUG! DEBUG! http://www.cpearson.com/Excel/DebuggingVBA.aspx
Go to the top of the page
 
Sami
post Oct 24 2019, 04:36 AM
Post#3



Posts: 66
Joined: 3-April 19



Thanks
it works perfectly
🙏 thanks again
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    12th December 2019 - 09:24 PM