Open Excel File Stored in Access Database (1 Viewer)

shaurya.rastogi

New member
Local time
Today, 05:14
Joined
Feb 9, 2007
Messages
3
I need to open an Excel file that has been stored in the Access Database using the insert Object functionality of MS Access manually.

What i am aware of is that i cant just read the field containing the Excel File into a Byte Array and pass it to the Excel object in C#,as the file is wrapped in the OLE Wrapper used by Access while inserting the file in database.

I have tried locating the Header of Excel file from the byte array and read the file from there on but it is not working.

while (true)
{
if (0xE11AB1A1E011CFD0 == BitConverter.ToUInt64(byStream, i))
break;
i++;
}
output.Write(byStream, i, byStream.Length - i-1);

byStream is a byte array into which i have read the Excel file from Database.
I am locating the Excel file header in the byte stream and am writing the byte array to a file from that location.But on opening the written file it dosent work.
Similar approach had worked in case of Images but now in this case.

Can some one please tell me as to how i can open the Excel File.
Can I use Interop.Access object to achieve the goal??
 

Anthony George

Registered User.
Local time
Today, 00:44
Joined
May 28, 2004
Messages
105
Does it have to be in VB

Hi

Can't you just open the table or query that you wish to export, click Tools/Office Links/Analyze it with MS Excel, and when the spreadsheet opens save it as a workbook.

If you must automate it I think it would be easier to set-up a macro and use a Command button to fire the macro.

Or maybe someone can come up with the VB code to do this: rolleyes:

Kindest regards

Tony
 

Anthony George

Registered User.
Local time
Today, 00:44
Joined
May 28, 2004
Messages
105
Does it have to be in VB

Hi

Can't you just open the table or query that you wish to export, click Tools/Office Links/Analyze it with MS Excel, and when the spreadsheet opens save it as a workbook.

If you must automate it I think it would be easier to set-up a macro and use a Command button to fire the macro.

Or maybe someone can come up with the VB code to do this :p :p

Kindest regards

Tony
 

Users who are viewing this thread

Top Bottom