Results 1 to 3 of 3

Thread: Excel Object

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2000
    Posts
    24
    Hi

    I am working with excel object and VB.
    I try to change the width for column B

    I write this:

    (i declare "ExcelSheet" as Excel.Application)

    ExcelSheet.Columns("B").Select
    ExcelSheet.Columns("B").Width = 20

    the first line is OK and VB raise an error when
    it try to pass the second line ( if i delete the second line
    i can see that Excel select column B)

    can you help me ?


  2. #2
    Lively Member
    Join Date
    Jun 2000
    Location
    A caravan park in the Midlands (UK)
    Posts
    101

    Talking This should help....

    You don't need to select anything. You can simply do:
    Code:
    MyWorkSheet.columns(1).columnwidth = iColWidth
    Works fine for me, and there's certainly no probs caused by changing the range or deleting rows/columns.
    Anakim

    It's a small world but I wouldn't like to paint it.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jun 2000
    Posts
    24

    Thanks

    Thanks for your help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width