Solved Opening an embedded Excel file and fill it up

freuzo

Member
Local time
Today, 02:55
Joined
Apr 14, 2020
Messages
98
Hi everyone,
I have and excel file attached and I want to open that file directly from vba without saving it first. So, after the file has been filled, I set it visible to the user whom can decide to save it later.

I'm using late bidind and know how to open and manipulate file but never did it with and embedded file.

Thanks.
 
Perhaps we'd benefit from a bit of clarity. What do these two terms mean?

"I have an excel file attached..."
"...an embedded file"
 
Perhaps we'd benefit from a bit of clarity. What do these two terms mean?

"I have an excel file attached..."
"...an embedded file"
I meant an Excel file embedded in a table of my database.
 
embedded as an Attachment?
 
see this demo.
Table1 has attachment field ExcelFile.
see the code on the Button on how to extract the workbook and open it.
there is no Late/Early binding on the code and no Reference made to Excel Object Library.
 

Attachments

Although it is possible to add an Excel file as an attached file in Access, it is both a bad idea and unnecessary.

It is a bad idea as attachments bloat your database and make it difficult to manage the Excel file.

It is unnecessary as you can link to the Excel file as a linked table and it will then always remain up to date.
Or you can just import the file as a local table. That may be better if you no longer intend to do any further edits in Excel
 
see this demo.
Table1 has attachment field ExcelFile.
see the code on the Button on how to extract the workbook and open it.
there is no Late/Early binding on the code and no Reference made to Excel Object Library.
Your demo wasn't exactly what I wanted it did the job, so thank you.
- extracting the file in the Temp folder,
- Gettting the file path and passing it to my line workbook.open(filepath) and open it to do what I want

My initial goal was to somehow pass the attached file location directly to the workbook.open line (so without having to store it first in a folder).
 
Although it is possible to add an Excel file as an attached file in Access, it is both a bad idea and unnecessary.

It is a bad idea as attachments bloat your database and make it difficult to manage the Excel file.

It is unnecessary as you can link to the Excel file as a linked table and it will then always remain up to date.
Or you can just import the file as a local table. That may be better if you no longer intend to do any further edits in Excel

Yes but for this particular case I dont want the users to access the original template. I don't want any alteration on its design.
 
Yes but for this particular case I dont want the users to access the original template. I don't want any alteration on its design.

Not a problem. The design of linked Excel tables cannot be directly altered from Access.
In fact, the linked Excel data is also read only in Access by default
 

Users who are viewing this thread

Back
Top Bottom