+ Reply to Thread
Results 1 to 3 of 3

VBA Excel to Word Export Formatting Issue

  1. #1
    Registered User
    Join Date
    11-23-2022
    Location
    United States
    MS-Off Ver
    365
    Posts
    4

    VBA Excel to Word Export Formatting Issue

    I am using the following code to export data from Excel into Word. I need the word document to contain only text - it currently is formatted as a table. I have tried a variety of coding, but cannot get it to work. I am very new to VBA and am sure the fix is simple so I apologize in advance if this is a stupid question. Thank you very much!

    Current VBA Module

    Sub export_excel_to_word()
    Set obj = CreateObject("Word.Application")
    obj.Visible = True
    Set newObj = obj.Documents.Add
    ActiveSheet.Range("A44:D144").Copy
    newObj.Range.Paste
    Application.CutCopyMode = False
    obj.Activate
    newObj.SaveAs Filename:=Application.ActiveWorkbook.Path & "" & ActiveSheet.Name
    End Sub

  2. #2
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,239

    Re: VBA Excel to Word Export Formatting Issue

    Try it
    Please Login or Register  to view this content.
    Artik

  3. #3
    Registered User
    Join Date
    11-23-2022
    Location
    United States
    MS-Off Ver
    365
    Posts
    4

    Re: VBA Excel to Word Export Formatting Issue

    Worked like a charm! I cannot thank you enough!!!

+ 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. How to export to existing Word bookmark AND set formatting
    By jontherev in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-31-2022, 05:09 PM
  2. Replies: 0
    Last Post: 11-10-2016, 10:18 AM
  3. How do I export an Excel worksheet to Word with some specific formatting?
    By jasonfromchico in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-30-2015, 04:26 PM
  4. Replies: 0
    Last Post: 01-25-2013, 07:03 AM
  5. Control word from vba/excel - export multiple oleobjects to word
    By mathengineer in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-17-2012, 11:09 AM
  6. Replies: 2
    Last Post: 06-26-2010, 02:42 AM
  7. Replies: 1
    Last Post: 05-19-2010, 07:20 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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1