Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > VBA / Office Integration > Excel > help, opening a binary .dat data file with Excel


Reply
 
Thread Tools Display Modes
  #1  
Old 04-04-2003, 07:34 AM
Sir Waxalot Sir Waxalot is offline
Newcomer
 
Join Date: Apr 2003
Posts: 2
Unhappy help, opening a binary .dat data file with Excel


I want to open a binary .dat data file in Excel. I know you can open a .dat text file, but I don't know how to open a binary file in Excel. I know how to convert a binary .dat data file to a comma separated variable (CSV) using matlab, but I want to use visual basic and open it in excel. I'm trying to eliminate the need for the converting step in matlab. Has anyone done this or can you point in the right direction.
Reply With Quote
  #2  
Old 04-06-2003, 09:40 PM
Legend Legend is offline
Contributor
 
Join Date: Dec 2002
Posts: 542
Default

Code:
Public bytFileArray() As Byte Sub OpenFile(strfileName As String) Dim lngFileNumber As Long lngFileNumber = FreeFile Dim lngFileLength As Long lngFileLength = FileLen(strfileName) ReDim bytFileArray(lngFileLength) As Byte Open strfileName For Binary As lngFileNumber Get lngFileNumber, , bytFileArray Close lngFileNumber End Sub


If you know that the file is a text file, then you can read it into an appropriately dimensioned string instead.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Installation Problem - PLs help urgenlty dpdsouza Installation / Documentation 4 12-02-2004 07:09 PM
Doesn't want to register! MikeyM Installation / Documentation 5 03-02-2003 08:22 PM
Two apps opening the same file ?? Logicworks General 2 02-26-2003 01:44 PM
Error opening Excel file TomGuy Word, PowerPoint, Outlook, and Other Office Products 7 05-06-2002 10:48 AM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->