Inserting column in Excel using VB 6 ?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Inserting column in Excel using VB 6 ?

  1. #1
    Join Date
    Jan 2006
    Posts
    2

    Inserting column in Excel using VB 6 ?

    How can I insert column in Excel using VB 6 ?
    I write this code, but it does not work properly.
    Can anyone help me?
    Code:
    Private Sub Command1_Click()
    
            Dim Ex As Object
            Dim ws As Object
            Set Ex = CreateObject("Excel.Application")
            Ex.Workbooks.Add (App.Path & "\test.xlt")
            
            Set ws = Ex.Worksheets(1)
    
            ws.Range("I3").Select
            ws.Selection.EntireColumn.Insert
            
            
            Ex.Visible = True
    
    End Sub

  2. #2
    Join Date
    Dec 2003
    Posts
    2,750
    The code should insert a column before the currently selected column. What is it that isn't working for you?
    Paul
    ~~~~
    Microsoft MVP (Visual Basic)

  3. #3
    Join Date
    Jan 2006
    Posts
    2
    VB 6 says than object does not support this method.

    but thanks, I alrady find answer.

Similar Threads

  1. Addressing Excel on screen from VB
    By dmb-job in forum VB Classic
    Replies: 0
    Last Post: 06-10-2005, 07:00 PM
  2. VB to excel export
    By Ananthakrishnan in forum VB Classic
    Replies: 3
    Last Post: 05-20-2005, 12:01 PM
  3. The day that everything went wrong!!!
    By WHYVB? in forum .NET
    Replies: 0
    Last Post: 10-03-2001, 10:14 AM
  4. Replies: 84
    Last Post: 01-29-2001, 02:12 PM
  5. Using Excel with VB
    By Blair in forum VB Classic
    Replies: 3
    Last Post: 07-03-2000, 10:02 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center