+ Reply to Thread
Results 1 to 2 of 2

Excel 2007 vba question

  1. #1
    Forum Contributor
    Join Date
    03-24-2004
    Location
    Edam Netherlands
    Posts
    181

    Excel 2007 vba question

    L.S.

    The code:

    vFileName = Application.GetOpenFilename("CSV Files (*.csv), *.csv", 1, "Select csv file.")
    Sheets.Add Type:=vFileName

    worked fine in excel 2003 vba but in excel 2007 vba it gives the error:

    Run-time error '1004':
    Method 'Add' of object 'Sheets' failed

    The code line :

    Sheets.Add Type:="D:\overview.csv"

    worksfine in both versions.

    Can someone help me with this....?

    kaak

  2. #2
    Nick Hodge
    Guest

    Re: Excel 2007 vba question

    Kaak

    Works fine for me in both versions (2003 and 2007)

    --
    HTH
    Nick Hodge
    Microsoft MVP - Excel
    Southampton, England
    www.nickhodge.co.uk
    [email protected]HIS


    "Kaak" <[email protected]> wrote in message
    news:[email protected]...
    >
    > L.S.
    >
    > The code:
    >
    > vFileName = Application.GetOpenFilename("CSV Files (*.csv), *.csv", 1,
    > "Select csv file.")
    > Sheets.Add Type:=vFileName
    >
    > worked fine in excel 2003 vba but in excel 2007 vba it gives the
    > error:
    >
    > Run-time error '1004':
    > Method 'Add' of object 'Sheets' failed
    >
    > The code line :
    >
    > Sheets.Add Type:="D:\overview.csv"
    >
    > worksfine in both versions.
    >
    > Can someone help me with this....?
    >
    > kaak
    >
    >
    > --
    > Kaak
    > ------------------------------------------------------------------------
    > Kaak's Profile:
    > http://www.excelforum.com/member.php...fo&userid=7513
    > View this thread: http://www.excelforum.com/showthread...hreadid=556333
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1