Results 1 to 5 of 5

Thread: Show methods from Excel

  1. #1

    Thread Starter
    Fanatic Member mutley's Avatar
    Join Date
    Apr 2000
    Location
    Sao Paulo - Brazil
    Posts
    709

    Show methods from Excel

    Hi

    I have a code below
    Code:
     Dim xlApp As Object
    
     'Create an instance of Excel and add a workbook
        Set xlApp = CreateObject("Excel.Application")
        Set xlWb = xlApp.Workbooks.Add
        Set xlWs = xlWb.Worksheets("Sheet1")
    
     with xlApp
        etc
    
     end with
    When I put dot inside with, It did not show methods
    I look References and reference of the excel is right


    tia

  2. #2
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: Show methods from Excel

    When you latebind with excel then you don't get intellisense however when you earlybind with excel then you will get what you want...


    Early binding vs Late binding has been covered umpteen times in the forum... do a search and you will get what you seek Also check out the awesome tutorial by Si on how to interact with excel

    Hope this helps...
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  3. #3
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Show methods from Excel

    There is a link to the tutorial in my signature.

    In this case all you need to do is declare the variables with their "proper" data types, eg:
    Code:
    Dim xlApp As Excel.Application
    I recommend changing them back to "Object" (and removing the reference) before you compile the program.

  4. #4

    Thread Starter
    Fanatic Member mutley's Avatar
    Join Date
    Apr 2000
    Location
    Sao Paulo - Brazil
    Posts
    709

    Re: Show methods from Excel

    Very Thank You

    But, How can I to do export only a column from recordset to Excel ?

  5. #5
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Show methods from Excel

    If your recordset only contains that one column, the easiest way is CopyFromRecordset as shown in the tutorial.

    If your recordset has other columns that you don't want to show, the easiest way is to loop the recordset, and use Cells or Range to put the values from that field into the worksheet.

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