Results 1 to 2 of 2

Thread: ole and loading file

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Location
    UK
    Posts
    164

    ole and loading file

    Hi I need to place a small spread sheet on one of my forms. I decided to use OLE for this purpose. Unfortunatly the OLE thing does not seem to want to load files. I get the error message
    "contents of ole stream not in correct format"

    Here is the code I am using:

    Dim fnum As Integer

    CommonDialog1.ShowOpen
    fnum = FreeFile
    Open CommonDialog1.FileName For Binary As #fnum
    OLE1.ReadFromFile (fnum)
    Close #fnum

    Or is there a better way to embed a spreadsheet on a form?

    I am using vb6 SP5 on Win 2k professional.

    Any ideas?

    Thanks,

    Alex
    ASP, SQL, VB6, Java Script and dubious guitar playing skills.

  2. #2
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    hmm.. on thin ice here , but try this

    VB Code:
    1. OLE1.CreateEmbed CommonDialog1.FileName

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width