+ Reply to Thread
Results 1 to 1 of 1

workbooks.open with parameters

  1. #1
    Registered User
    Join Date
    07-30-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    2

    workbooks.open with parameters

    Hi All,

    I have a number of csv files that are in a specific folder. I am trying to open each one of them and copy data from them into an excel workbook. in the CSV file i also have date in one of the columns. the date in csv file is in dd/mm/yyyy format, when i try to copy the date sometimes it copies as dd/mm/yyyy someother times it gets copied as mm/dd/yyyy. I browsed the net and found out that we have to enable Local:=True in the workbooks.open function.

    I am trying to use this syntax:
    tp = workbooks.Open(Folder & "\*.CSV",,,,,,,,,,,,,True ,) I get a compiler error _ Expected: expression
    i have declared tp as workbook/object/variant and tried but still it did not work.
    when ever i use just workbooks.open(Folder & "\*.CSV") it works fine, but I really need to pass True to "Local" parameter of Open.
    what is the correct syntax here...Any ideas?
    Thanks in advance.

    ---------- Post added at 12:01 PM ---------- Previous post was at 11:33 AM ----------

    hi all,
    found out..
    its just that when i had declared tp as object

    i need to use
    Set tp = Workbooks.Open(FileName:=Folder & "\" & FName, local:=True)[COLOR="Silver"]
    Last edited by arlu1201; 07-30-2012 at 02:56 AM. Reason: Removed dup post.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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