+ Reply to Thread
Results 1 to 12 of 12

Convert PDF to WORD using Excel VBA

  1. #1
    Registered User
    Join Date
    04-28-2014
    Location
    Florida
    MS-Off Ver
    Excel 2007, 2010, 2011 Mac. 2013,2016. I use 2011 and 2016 the most
    Posts
    90

    Convert PDF to WORD using Excel VBA

    I have existing VBA code to convert Excel to PDF. Once the PDF file is created, I would like to convert the PDF file which was just created to word, in the same Sub routine. This way I will have both file formats in the same folder. Currently all I can create is a PDF File using excel VBA. This is what I have and it works fine for creating the PDF File. I'm using Excel 2016 Pro and Adobe xl Pro. I know how to do this in Adobe but I want it automatically done using VBA. The reason I want to do it this way is because I want the sheets to look identical. Doing it manually, using Adobe, they do. The VBA code needed would go just before the last "End If". I've searched for a way but so far I haven't found a way. Any help would be appreciated.

    Please Login or Register  to view this content.
    Last edited by jeffreybrown; 09-02-2017 at 09:14 AM. Reason: Fixed code tags

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Convert PDF to WORD using Excel VBA

    .
    Did a quick search and found this. Haven't tried it.

    http://www.myengineeringworld.net/20...iles-into.html

  3. #3
    Registered User
    Join Date
    04-28-2014
    Location
    Florida
    MS-Off Ver
    Excel 2007, 2010, 2011 Mac. 2013,2016. I use 2011 and 2016 the most
    Posts
    90

    Re: Convert PDF to WORD using Excel VBA

    I found that too. Can't try it till tomorrow at work. I was hoping i only needed a few lines of code to make it happen...like when it was converted to pdf. Not sure how i would fit it in my existing code. Thanks anyway. I'll keep trying

  4. #4
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Convert PDF to WORD using Excel VBA

    Why are you trying to round-trip via PDF? You could just output the desired range direct from Excel to Word. Plus the Word content will have a far better chance of accurately reflecting the worksheet content.
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  5. #5
    Registered User
    Join Date
    04-28-2014
    Location
    Florida
    MS-Off Ver
    Excel 2007, 2010, 2011 Mac. 2013,2016. I use 2011 and 2016 the most
    Posts
    90

    Re: Convert PDF to WORD using Excel VBA

    If it can't be done, that's fine. I'll do it manually.

  6. #6
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Convert PDF to WORD using Excel VBA

    You still haven't said why you're trying to get your Excel data from the PDF into Word instead of sending it direct to Word from Excel, which would be far simpler...

  7. #7
    Registered User
    Join Date
    04-28-2014
    Location
    Florida
    MS-Off Ver
    Excel 2007, 2010, 2011 Mac. 2013,2016. I use 2011 and 2016 the most
    Posts
    90

    Re: Convert PDF to WORD using Excel VBA

    my one excel sheet that i convert to PDF spans 5 PDF sheets. In the middle of those sheets is a table that I can't seem to incorporate since the table is the entire size of a landscape format and all others are portrait in my excel sheet. It copies over wrong to word format...everything is portrait so only part of the table is visible. Since you can't rotate a table 90* in excel i found another way. I made the table out of a lot of text boxes which i rotated 90*. Now, when i save as PDF everything is good and the PDF has the table still at 90* and in portrait format. But when i save as word the table is all messed up like its trying to rotate it.So i tried to manually convert "From Acrobat" the PDF to word, everything works fine...AND the table is actually saved in Landscape format and everything looks good and i still have full edit capibility. I have tried to figure out how to do this the way you are telling me but the table is the only thing that doesent work. Since I know manually converting the PDF to word works, i wanted to try that. I hope this makes sense

  8. #8
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Convert PDF to WORD using Excel VBA

    All you need do with Word, then, is to insert 'Next Page' Section breaks either side of the landscape table and set that Section's orientation to landscape when exporting from Excel. Importing from a PDF would likely still require you to do that.

    Alternatively, you could insert the table into a Word textbox and rotate that.
    Last edited by macropod; 09-07-2017 at 11:44 PM.

  9. #9
    Registered User
    Join Date
    04-28-2014
    Location
    Florida
    MS-Off Ver
    Excel 2007, 2010, 2011 Mac. 2013,2016. I use 2011 and 2016 the most
    Posts
    90

    Re: Convert PDF to WORD using Excel VBA

    So back to my original post ,since i can't seem to get anything else to work. Is there a way to do it. Excel VBA to convert PDF to Word?

  10. #10
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Convert PDF to WORD using Excel VBA

    What have you tried to do vis-à-vis outputting the content to Word, including with the use of Section breaks?

  11. #11
    Registered User
    Join Date
    04-28-2014
    Location
    Florida
    MS-Off Ver
    Excel 2007, 2010, 2011 Mac. 2013,2016. I use 2011 and 2016 the most
    Posts
    90

    Re: Convert PDF to WORD using Excel VBA

    I've already stated that the only thing that works right is when i manually convert a pdf to word. I have tried all ways in vba that I know but nothing formats it right. I want to convert PDF to WORD in vba automatically.

  12. #12
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Convert PDF to WORD using Excel VBA

    So show use the code for direct conversion that you say doesn't work - and show us, too, that you've taken on board the advice to employ Section breaks as required.

+ 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. [SOLVED] Convert this word VBA to excel
    By bdouglas1011 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-02-2014, 02:13 PM
  2. Convert Word to Excel based upon Word Table of Contents
    By jcappuccino7 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-06-2013, 01:25 PM
  3. Convert Word (Doc) to excel
    By keith6292 in forum Excel General
    Replies: 2
    Last Post: 04-29-2011, 06:24 PM
  4. Convert word doc to excel
    By ssuriyani2 in forum Excel General
    Replies: 0
    Last Post: 12-15-2009, 10:17 PM
  5. convert excel to word
    By Joe Black in forum Excel General
    Replies: 2
    Last Post: 11-23-2005, 08:55 PM
  6. Convert Word to excel
    By sostabarak in forum Excel General
    Replies: 1
    Last Post: 11-01-2005, 10:05 AM
  7. [SOLVED] convert word doc to excel
    By cyndimac in forum Excel General
    Replies: 3
    Last Post: 03-23-2005, 11:06 PM

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