+ Reply to Thread
Results 1 to 6 of 6

vba error for writeline

  1. #1
    Registered User
    Join Date
    11-26-2018
    Location
    india
    MS-Off Ver
    2007
    Posts
    22

    vba error for writeline

    I am getting error while using writeline() when it was writing text with special character ≠

    text = if Q1 ≠ NO

    So please help me to handle this error and write this content in new file
    Last edited by AliGW; 09-29-2021 at 04:19 AM. Reason: SOLVED tag removed.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,783

    Re: vba error for writeline

    You have marked this as solved - is it?

    In Excel, the 'not equal' symbol is usually <>.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    11-26-2018
    Location
    india
    MS-Off Ver
    2007
    Posts
    22

    Re: vba error for writeline

    Actually there is text "if Q1 ≠ NO" in excel file and when i am using writeline() function to write this text to new file, it is throwing error.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,783

    Re: vba error for writeline

    OK - You need to remove the solved tag from your thread, then. Sorry - I can't help myself with your query.
    Last edited by AliGW; 09-29-2021 at 03:47 AM.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,428

    Re: vba error for writeline

    You need to share the Excel file AND your code so we're not all starting from scratch.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  6. #6
    Valued Forum Contributor Haluk's Avatar
    Join Date
    02-14-2019
    Location
    Turkiye
    MS-Off Ver
    2010 - 64 Bit on Windows-11 (22 H2) 64 Bit
    Posts
    1,150

    Re: vba error for writeline

    @nilambari28 ;

    If range A1 is housing the text "if Q1 ≠ NO" then, try the following code in which WriteLine method is used.

    The magic is the last "True" parameter in the "CreateTextFile" function, which forces the "textStream" object to create the text file as a unicode file.

    Please Login or Register  to view this content.
    Last edited by Haluk; 09-29-2021 at 05:21 AM.

+ 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] vba writeline method
    By hgchas in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 10-25-2019, 12:00 PM
  2. [SOLVED] Run-tim error -2147467259(80004005): Automation error Unspecidied error
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-25-2014, 12:12 PM
  3. Excel macro (compile error. syntax error.) error
    By salar_younis in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-06-2014, 06:11 AM
  4. Error "run-time Error '1004': General Odbc Error
    By D4WNO77 in forum Access Tables & Databases
    Replies: 2
    Last Post: 07-16-2012, 09:55 AM
  5. Error 75 File/Path access error, sometimes Error 1004
    By smokebreak in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 02-16-2011, 02:35 PM
  6. Replies: 3
    Last Post: 05-11-2007, 09:38 AM
  7. Error Handling - On Error GoTo doesn't trap error successfully
    By David in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-16-2006, 02:10 PM

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