+ Reply to Thread
Results 1 to 4 of 4

strange behaviour while loading *.csv file

  1. #1
    Valued Forum Contributor Eastw00d's Avatar
    Join Date
    02-29-2020
    Location
    Breda, NL
    MS-Off Ver
    2016, 2019
    Posts
    808

    strange behaviour while loading *.csv file

    Hi all,
    I am experiencing a strange behaviour from my Excel.
    If I am opening manually a *.csv file, the file opens in 1 column with all the text as is in the CSV-file (when opened in Notepad as txt).

    However if I open with a macro, the file is upon opening already converted and divided in columns. (This has changed recently and I cannot figure out why)
    For me this is at the moment unwanted, as my macro is dealing with the text in one column. And as side-effect, the date-labels are completely messed up. Like 14th october = 14-10-2021, but 1st of october is displayed as 10-01-2021 (like 10th of January)

    How is this this behavior to be avoided? I mean that the file should be opened as before (i.e. manually), as text in one column in VBA.

    Cheers
    Erwin
    I started learning VBA because I was lazy ...
    Still developing.... being more lazy...

  2. #2
    Registered User
    Join Date
    11-16-2016
    Location
    NC
    MS-Off Ver
    2007, 2019
    Posts
    78

    Re: strange behaviour while loading *.csv file

    Look in the ThisWorkbook_Module and see if there is code that directs the workbook to automatically process the data upon opening.

  3. #3
    Valued Forum Contributor Eastw00d's Avatar
    Join Date
    02-29-2020
    Location
    Breda, NL
    MS-Off Ver
    2016, 2019
    Posts
    808

    Re: strange behaviour while loading *.csv file

    Thank you for the suggestion, but the mentioned file is an output of bankstatements. (Export from bank). No ThisWorkbook Modules active.
    I have found a way around it to import the file in a variable and then extract this variable line by line into the spreadsheet.

    Cheers
    Erwin

  4. #4
    Registered User
    Join Date
    11-16-2016
    Location
    NC
    MS-Off Ver
    2007, 2019
    Posts
    78

    Re: strange behaviour while loading *.csv file

    Glad you have an answer.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] strange behaviour from vba
    By harryv27 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 04-14-2016, 04:50 AM
  2. Strange Behaviour
    By Mark@Work in forum Excel General
    Replies: 2
    Last Post: 09-30-2008, 12:22 PM
  3. [SOLVED] Strange behaviour - loading Excel clears Clipboard
    By Trevor Shuttleworth in forum Excel General
    Replies: 1
    Last Post: 08-19-2006, 05:10 PM
  4. [SOLVED] Strange if(***) behaviour?
    By Excel 2003 - SPB in forum Excel General
    Replies: 6
    Last Post: 08-06-2006, 12:35 PM
  5. Strange VBA Behaviour
    By Ricko in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-28-2005, 03:05 AM
  6. (Leo) Strange print to file behaviour
    By Leo in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-14-2005, 09:05 AM
  7. [SOLVED] Very strange add-in file behaviour
    By RB Smissaert in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 05-18-2005, 02:45 PM

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