1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: VB Net Excel

Discussion in 'Software Development' started by cjeffc, Dec 27, 2010.

Thread Status:
Not open for further replies.
  1. cjeffc

    cjeffc Thread Starter

    Joined:
    Apr 10, 2009
    Messages:
    31
    In a VB 2008 program, I am exporting an object array ( Friend theIncludes(,) AsObject ) to excel using the code below. Everything works wonderfully, unless one of the array elements includes a string that excel decides to intrepret for me. How can I get excel to stop changing a string of 12/10 to Dec-10...I have tried numberformat = "General" and "Text" to no avail as well as .value versus .value2

    xlsWB.Sheets(1).Select()
    If iIncludes > 0 Then
    xlsRange = xlsSheet.Range("A1:" + colOut_LastExcel + iIncludes.ToString)
    xlsRange.Value2 = theIncludes
    ' xlsRange.Value = theIncludes
    EndIf


    Many thanks
    cjeffc
     
  2. cjeffc

    cjeffc Thread Starter

    Joined:
    Apr 10, 2009
    Messages:
    31
    xlsRange.Numberformat = "@" ' use at for text
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Similar Threads - Solved Excel
  1. Radheshyam
    Replies:
    0
    Views:
    370
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/971028

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice