Solved

Excel/VBA Date Format Problems

Posted on 2011-02-21
2
315 Views
Last Modified: 2012-05-11
I am currently attempting to open a CSV file using VBA however when the CSV file is opened using the following code....

    CSVFile = Application.GetOpenFilename("", , "CSV Import File")
    Application.DefaultFilePath = origDefPath
   
    If CSVFile = "" Then
   
    Else
   
    Set SageWorkbook = Application.Workbooks.Open(CSVFile)

One column contains invoice date information and on certain rows the date format is alterting to MM-DD-YYYY while other remain DD-MM-YYYY.  If I open the file manually the dates are fine.

Please can anyone advise
0
Comment
Question by:Damozz
2 Comments
 
LVL 1

Expert Comment

by:dev00790
ID: 34942754
What are the date formats in the CSV file?
0
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 500 total points
ID: 34942841
Have you tried using Workbooks.OpenText instead of WOrkbooks.Open and specifying the Local:=True parameter?
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question