Posts by palmoura

    Re: Copy/Paste Data Without Control Objects


    Quote from Dave Hawley

    Shouldn't you be recording the pastespecial in Word?


    I'm copuing from Excel and paste in word, but the code is working in Excel.
    I try in Excel and I tried in word and the result was


    Code
    Selection.PasteExcelTable False, False, False

    Re: Copy/Paste Data Without Control Objects


    Hy again Dave,
    I've recorded a macro and the result was :


    Code
    Range("A33:H38").Select
        Selection.Copy
        Sheets("Sheet1").Select
        Range("D5").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Range("D12").Select
        Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
            False, Transpose:=False


    but when I try to apply in my code it gives me a run time error:


    Code
    If wordDoc.Bookmarks.Exists("pts") = True Then
             wordDoc.Bookmarks("pts").Range.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
            False, Transpose:=False
           End If


    btw ....
    the runtime error is Run-time error '448':
    Named argument not found

    Re: Copy/Paste Data Without Control Objects


    I try to explain it better, this is my code to select a range, and paste it in word Document

    Code
    Sheet6.Activate
           Sheet6.Range("A12:N24").Select
           Selection.Copy
           If wordDoc.Bookmarks.Exists("pts") = True Then
             wordDoc.Bookmarks("pts").Range.PasteSpecial
           End If


    I select the range and paste it in the document, but this range is a table that has some control buttons, but when is pasted in the document the buttons are pasted also.


    Kind rewards,


    Pedro

    Re: Copy Data From To An Automation Object


    Quote from Dave Hawley

    Use PasteSpecial.


    Hi Dave, thanks for the sugestion, but I'm using PasteSpecial, but it copied the buttons and comboBoxes, because when i'm selected the range it select the cells that has buttons.


    Kind rewards,


    *Pedro

    Re: Insert range in a word document


    Quote from Wigi

    Please help others in the Ozgrid spirit and tell how you did it.


    Sorry, but i didn't post my solution because I didn't checked if my solution was correct. Here it comes:


    I have an automation Object, i put a bookmark in that object and I create a range in that bookmark, then I did this

    Code
    Sheet6.Activate
           Sheet6.Range("A12:N24").Select
           Selection.Copy
           If wordDoc.Bookmarks.Exists("pts") = True Then
             wordDoc.Bookmarks("pts").Range.PasteSpecial
           End if

    Hi fellows,


    i'm working with excel and i have tables that gone to by copied to a document, but that tables has some controls like buttons, when i'm copying tables in VBA, Excel copy the buttons but i do'nt have to copy that, how can I do that?


    Kind Rewards,
    Pedro

    Hi fellows,


    I am work in an aplication in Excel, and I have to crate a report with data from the excel document. I have text in the word document and I have to paste a range in the word document, i'm trying to do that but he create a new document but i have to put in the document that excel program create and paste it after the text that I have in document. Can I do that?


    Kind rewards

    Re: bookmarks



    Hi,
    I did that on my code. I create a function


    Code
    Function clean_content_of_Bookmarks()
      With wordDoc
          .Bookmarks(bookmarkname).Range.Text = ""
        ' do the same to all bookmarks in the document
      End With
    End Function


    but it didn't clear the content, and wrote the text after the content in the docuement.

    Re: bookmarks


    Quote from Andy Pope

    When you say clean do you mean DELETE or CLEAR CONTENT?


    John's code is removing all the bookmarks when appending, which will cause your code to fail.


    sorry my explanation was not correct, when i say clean is to clear the content of the bookmark.
    Huges

    Re: bookmarks


    thanks for the help Johnccc,


    but i do'nt know wich tipe is the variable temp is an object? is a String?
    i try this code, but when i append the bookmark i have an error


    this is the function


    this is the code i try to put working


    huges

    hello fellows,


    I have a question.... i have a document(generated with data from excel) and everytime I generate a report sometimes i have to create new file or append the existing file, i have bookmarks in file, but when i'm trying to append the file he don't clean the bookmarks, i want to know how to clean the bookmarks.



    huges


    Pedro Moura

    Problem solved


    I solved my problem with this


    Re: Create a report in a word document using data from a workbook


    Quote from johnccc

    Sorry, forgot to make it clear that this is all controlled by a macro in Excel.


    Similar code should be able to be run this from Word, I just didn't have any to hand.


    John


    No probies John, U give me a big help. Thanks for the reply


    Kind rewards