DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  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, 06:00 PM
  2. VB to excel export
    By Ananthakrishnan in forum VB Classic
    Replies: 3
    Last Post: 05-20-2005, 11:01 AM
  3. The day that everything went wrong!!!
    By WHYVB? in forum .NET
    Replies: 0
    Last Post: 10-03-2001, 09:14 AM
  4. Replies: 84
    Last Post: 01-29-2001, 01:12 PM
  5. Using Excel with VB
    By Blair in forum VB Classic
    Replies: 3
    Last Post: 07-03-2000, 09:02 AM

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
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links