Results 1 to 5 of 5

Thread: WHAT IS WRONG WITH THIS?

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2000
    Location
    derby,UK
    Posts
    38

    Post

    I'M TRYING TO OPEN A DAT FILE BUT WHEN I CLICK ON THE FILE, IT SAYS IT NOT FOUND, HELP!!!

    CommonDialog1.Filter = "Data Files(*.dat)|*.dat"
    CommonDialog1.ShowOpen

    Dim loadedfile As String
    loadedfile = CommonDialog1.filename

    Dim Load As Long
    Load = Shell("" & loadedfile, vbNormalFocus)

  2. #2
    Frenzied Member
    Join Date
    Jan 2000
    Location
    Bellevue, WA, USA
    Posts
    1,357

    Post Try this

    To open a file, you need to specify the program to open it with...Try this:

    Code:
    Option Explicit
    
    Private Sub Command1_Click()
        Dim Load As Double
        Dim LoadedFile As String
        
        CommonDialog1.Filter = "Data Files(*.dat)|*.dat"
        CommonDialog1.ShowOpen
        
        LoadedFile = CommonDialog1.FileName
        Load = Shell("C:\WINDOWS\Notepad.exe " & LoadedFile, _
            vbNormalFocus)
    End Sub
    Make sure the path to notepad is correct!

    Edited by seaweed on 03-13-2000 at 05:14 PM
    ~seaweed

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 2000
    Location
    derby,UK
    Posts
    38

    Post

    yes, loads of times!

  4. #4
    Frenzied Member
    Join Date
    Jan 2000
    Location
    Bellevue, WA, USA
    Posts
    1,357

    Post Oops...

    I edited my reply after you responded...Check it again (it changed)

    ~seaweed

  5. #5

    Thread Starter
    Member
    Join Date
    Jan 2000
    Location
    derby,UK
    Posts
    38

    Post

    for them sort of problems go to
    http://www.geocities.com/CollegePark/Library/3001/vblink.html

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