Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export xls Ole data from MS Acess and read it as an xls workbook

Status
Not open for further replies.

t1hodges

MIS
May 8, 2003
54
in vba, demonstrate how to export excel files stored in Access as "long binary data" in an OLE data type field onto a network and readable using MS Excel.

i have created the following code but the excel file it creates isn't readable with MS Excel presumably because the .xls file created is still in long binary data format.

Public Function PushOleToXls()
Dim db As DAO.Database
Dim rs1 As DAO.Recordset
Set db = CurrentDb()
Set rs1 = db.OpenRecordset("tblLoadOLE") ' table where data is held
With rs1
Do Until .EOF = True
Dim nFileNum As Integer
Dim abytData() As Byte
nFileNum = FreeFile
strFile = "C:\temp\98432439.xls" ' xls file already created to receive the binary data
Open strFile For Binary Access Write As nFileNum
Field = !OLEFile 'field in the MS Access database that holds the actual binary data
abytData = Field
Put #nFileNum, , abytData
Loop
End With
End Function
 
HAve you tried the GetChunk method ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks PHV. Im new to using these methods :) I will investigate and try it. Please let me know how to use that method if you already know, else, i'll post my results later. And thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top