Vba to Inport PDF Creates one Column?

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
3,210
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hi Everyone,
I have this code to import data from a PDF to Excel Sheet.
The problem is it imports all the data as one column
is there something im missing ?

anyone know of a way to import from a pdf and have it look the same?

here my code

Code:
Sub PDFinport1()
 Dim wsLog As Worksheet, wsOutp As Worksheet
Set wsOutp = Sheets("Test1")
Filename = "F:\MY Docs1\New1\Hotel Excel File Updates\test1.pdf"
ShellExecute 0, "Open", Filename, "", "", vbNormalNoFocus
Application.Wait (Now + TimeValue("0:00:02"))
    SendKeys "^a", True
 Application.Wait (Now + TimeValue("0:00:02"))
    
   SendKeys "^c", True
   
   Application.Wait (Now + TimeValue("0:00:02"))
wsOutp.Paste Cells(1, 1)
Application.Wait (Now + TimeValue("0:00:01"))
SendKeys "%{F4}", True

End Sub

please help if you can

Thanks

Tony
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Because importing that way simply collects the content as a text stream; any structure and formatting is lost.
 
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,165
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top