Consulting

Results 1 to 10 of 10

Thread: How to paste value of cell A1 to cell B1 from corel draw12"

  1. #1

    Unhappy How to paste value of cell A1 to cell B1 from corel draw12"

    Hi!
    I'm a newbie in vba.
    I need copy the value of cell A1 an paste it in cel B2.
    I need to do that from corel draw 12 to Excel 2003.

    10x

  2. #2
    VBAX Contributor Aaron Blood's Avatar
    Joined
    Sep 2004
    Location
    Palm Beach, Florida, USA
    Posts
    130
    Location
    This probably belongs in the Office Integration forum...
    Done by firefytr..

    Personally, I've never messed with pulling things outta Corel.

  3. #3

    Here is what I have untill now

    Sub ATest() 
    Dim b As Object
    Set b = GetObject("D:\Alta-Lingua\HAAS 5\corel script\trados.xls")
    For n = 1 To 50 ' no of doc
    Documents(n).Activate
    Dim s As Shape
    For Each s In ActivePage.FindShapes(, cdrTextShape)
    s.Text.BeginEdit
    'line 1
    Set t = s.Text
    t.Story.Paragraphs.Item(1).Copy
    b.worksheets("temp").Paste Destination:=b.worksheets("temp").Range("A3") 'paste in cel A3
    b.worksheets("temp").Range("A3:A9") = b.worksheets("temp").Range("C3:C9").Value 'clean cells
    b.worksheets("temp").Range("B2:B8") = b.worksheets("temp").Range("C3:C9").Value 'clean cells
    b.worksheets("temp").Range("B1:B8") = b.worksheets("temp").Range("A3:A9").Value 'B1=A2
    b.worksheets("temp").Range("A1") = b.worksheets("temp").Range("A2").Value 'A1=A2
    For x = 1 To 600
    If b.worksheets("baza").cells(x, 3) = b.worksheets("temp").cells(1, 1) Then
    b.worksheets("temp").cells(1, 2) = b.worksheets("baza").cells(x, 4)
    Exit For
    End If
    Next x
    b.worksheets("temp").cells(1, 2).Copy
    SendKeys "^{v}", True
    'end line 1
    SendKeys "^{ }", True
    Next s
    'Next n
    End Sub





    My problem is that the values from the baza sheet no longer get in to the B1 cell.

  4. #4
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Hi, and welcome to VBAX
    If you select your code and click on the VBA button, it formats it as above, making it more readable. If you want to post an attachment, use the Go Advanced button below the message box and click on Manage Attachments. You can send zipped data files and a few other types.
    Regards
    MD

  5. #5
    10x

    I Solved my problem.

    If you (mdmackillop) think is helpful, I'll postit here

  6. #6
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    Quote Originally Posted by nfgiosanu
    If you (mdmackillop) think is helpful, I'll postit here
    Please do! (If I count.. )

  7. #7
    Sub HAAS5EPS()
    Dim q
    Dim b As Object
    Set b = GetObject("D:\Alta-Lingua\HAAS 5\corel script\trados.xls")
    Set tt = b.worksheets("temp")
    Set tb = b.worksheets("baza")
    Dim cdr
    cdr = Documents.Count
    For n = 2 To cdr ' no of doc
    Documents(n).Activate
    Dim s As Shape
    For Each s In ActivePage.FindShapes(, cdrTextShape) 
    s.Text.BeginEdit
    Set t = s.Text
    q = t.Story.Paragraphs.Count
    For w = 1 To q
    t.Story.Paragraphs.Item(w).Copy
    tt.Range("A3:A7").clearcontents
    tt.Paste Destination:=tt.Range("A3") 'paste in cel A3
    tt.cells(1, 2) = tt.cells(2, 1) 'B1=A2
    tt.Range("A1") = tt.Range("A2").Value 'A1=A2
    For x = 1 To 600
    If tb.cells(x, 3) = tt.cells(1, 1) Then
    tt.cells(1, 2) = tb.cells(x, 4)
    Exit For
    End If
    Next x
    tt.cells(1, 2).Copy
    SendKeys "^{v}", True
    SendKeys "{ENTER}", True
    Next w
    SendKeys "{BACKSPACE}", True
    SendKeys "^{ }", True
    Next s
    Next n
    End Sub




    Please post your comments.
    I'm want to learn and optimize the script

    10x

  8. #8
    Quote Originally Posted by firefytr
    Please do! (If I count.. )
    U count too

  9. #9
    Site Admin
    The Princess VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location
    nfgiosanu: Thanks!! Some of us DO have CorelDraw and have never used it with VBA! The more, the merrier!!



    You can mark your question solved (if it is) by hitting Thread Tools (at the top) and choosing Mark Solved.
    ~Anne Troy

  10. #10

    next step

    now i try to give a graphical interface to my script

Posting Permissions

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