+ Reply to Thread
Results 1 to 3 of 3

Explanation of following vba code

  1. #1
    Registered User
    Join Date
    04-04-2017
    Location
    India
    MS-Off Ver
    2007
    Posts
    17

    Explanation of following vba code

    Can someone please help me what this code is doing?
    Thanks in advance!

    Sub Copy_Tables()
    Dim item As MailItem, x%
    Dim r As Object 'As Word.Range
    Dim doc As Object 'As Word.Document
    Dim xlApp As Object
    Set xlApp = CreateObject("Excel.Application")

    'xlApp.Workbooks.Open FileName:="D:\T.xlsm", AddTOMRU:=False, UpdateLinks:=False

    Set wkb = xlApp.Workbooks.Add
    xlApp.Visible = True

    Dim wks As Object
    Set wks = xlApp.Sheets(1)

    For Each item In Application.ActiveExplorer.Selection
    Set doc = item.GetInspector.WordEditor
    For x = 1 To doc.tables.Count
    Set r = doc.tables(x)
    r.Range.Copy
    wks.Paste
    wks.Cells(wks.rows.Count, 1).End(3).Offset(1).Select
    Next
    Next
    End Sub


    If I want to save the new excel file with some name, then what should I do for that?

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,523

    Re: Explanation of following vba code

    What is the code supposed to do?

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,037

    Re: Explanation of following vba code

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. give me explanation of code
    By keshavtale in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-25-2015, 10:12 AM
  2. [SOLVED] Explanation of this macro code please
    By painterartist in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-02-2014, 07:45 PM
  3. Code Explanation Help Please
    By gerbansprawl in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-19-2013, 09:30 AM
  4. [SOLVED] I need VBA explanation on this code please help me!!!
    By venkatpvc in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-23-2013, 07:38 PM
  5. [SOLVED] Code explanation please
    By Geordie in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-15-2012, 08:12 AM
  6. explanation of code
    By leanne2011 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-29-2011, 06:50 PM
  7. Code explanation
    By bajdr47 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-06-2011, 12:30 PM

Tags for this Thread

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1