0

I'm fairly new to VBA. I'm trying to create a user form where the user can select another workbook as read only and copy some of the data to the current workbook. I don't want the other workbook to open.

I found this https://www.encodedna.com/excel/copy-data-from-closed-excel-workbook-without-opening.htm but the excel document is hard coded. Is it possible to select a workbook dynamically, through a file dialog without that workbook popping up?

Thank you

Jummi
  • 123
  • 1
  • 13
  • You can open the new workbook in a window that is .visible = False. It will still load, but will not be visible to the user, and woudl need to be closed after you're completed using it. – Cyril Aug 02 '18 at 17:46
  • you are going to have to open it, just hide it and use screen updating (on/off) and no one will ever know. – Wookies-Will-Code Aug 02 '18 at 17:52
  • Do you just need data, or other information? If it's data only you can connect to it via ODBC and ADO. – Comintern Aug 02 '18 at 17:57
  • 1
    FYI, the title in that link is a lie. It is clearly opening the file where is says `Workbooks.Open()`. It's just not showing it to the user. If you really want to read the file, without opening the Workbook in Excel, take a look at the ODBC/ADO route as @Comintern said. – Profex Aug 02 '18 at 19:22
  • 1
    Possible duplicate of [Getting File Location and Name for Excel VBA](https://stackoverflow.com/questions/43550138/getting-file-location-and-name-for-excel-vba) – Profex Aug 02 '18 at 19:35
  • Thanks for the help. I am only interested in reading the data and getting it's cell location. I will try to look into using ODBC and ADO. – Jummi Aug 02 '18 at 22:20

0 Answers0