vba word pdf table to excel
The solution for “vba word pdf table to excel” can be found here. The following code will assist you in solving the problem.
Sub ImportPDFTable()
Dim wdDoc As Object
Dim wdFileName As Variant
Dim wrd As Object
Dim ApplicationIsRunning As Object
Dim IsWordRunning As Boolean
Dim TableNo As Integer
Dim iRow As Long, iCol As Integer, iCount As Integer
wdFileName = Application.GetOpenFilename(“PDF files,*.pdf,Word files,*.doc*”, , _
“Browse for file containing table to be imported”)
If wdFileName = False Then Exit Sub ‘(user cancelled import file browser)
Set wrd = CreateObject(“Word.Application”)
Set wdDoc = wrd.Documents.Open(wdFileName) ‘open PDF file in Word
wrd.Visible = False
wrd.Selection.WholeStory
wrd.Selection.Copy
ActiveSheet.PasteSpecial Format:=”Text” ‘optional – pastes whole document for easy checking
Range(“A1”).Select
With wdDoc
TableNo = wdDoc.tables.Count
If TableNo = 0 Then MsgBox “This document contains no tables”, vbExclamation, “Import Word Table”
For iCount = 1 To TableNo
Worksheets.Add
‘Range(“A:M”).NumberFormat = “@”
TableNo = iCount
With .tables(TableNo)
‘copy cell contents from Word table cells to Excel cells
For iRow = 1 To .Rows.Count
For iCol = 1 To .Columns.Count
On Error Resume Next
Cells(iRow, iCol) = WorksheetFunction.Clean(.cell(iRow, iCol).Range.Text)
Next iCol
Next iRow
End With
Next iCount
End With
Set wdDoc = Nothing
wrd.Quit
Set wrd = Nothing
End Sub
More questions on [categories-list]
- checking and changing system volume vb.net checking and changing system volume vb.net
- selecttoken em vbnet e json
- how to call gcd in vba
- pivot data source not accepting table named range vba
- Excel PasteSpecial Format:= can’t find the argument
- refresh token em vb net
- menus act like radio buttons vb.net
- power query M substract minimum value of column -dax
- how to concatenate more than 40 lines in vba how to concatenate more than 40 lines in vba
- discern between file and folder given path vb.net
- putting marquee in vb.net
- code for reading letters only in vb 6
- vba array dimensions
- text to speech vb.net
- set datetimepicker value to null vb
- how to correct a number to 2 decimal places in vba
- System.Data.OleDb.OleDbException: ‘No value given for one or more required parameters.’
- vba file chooser
- vba code to add new column in table
- how save excel through visual basic
- make your computer talk vbscript
- for i in range vba
- vbnet make a string to unicode converter
- create new worksheet excel visual basic
- vba sendkeys
- vba is integer
- remove series name from legendvbnet
- priavte sub with multiple handels find sneder
- openfiledialog specific folder
- vbnet check if string is only symbols
- tester si une case est vide vba
- vbnet check if number is even or odd
- find days in month vba
- excel vba multiply cell value
- sort dictionary by key vba
- excel vba delete columns in range excel vba delete columns on another sheet
- VBA – Print Whole Workbook VBA – Print Whole Workbook
- excel vba formatconditions range
- VBA Dictionary Data Type
- excel vba assign shortcut key to button
- vba comment shortcut vba comment shortcut
- build an index all files of a FTP site
- vbnet find highest value in chart
- vb net dgv doesn’t keep currency format
- delete all controls from list of control vb.net delete all controls in an area vb
- vlookup columns not next to each other
- how to get value from clipboard in vbnet
- afficher un message d’erreur vba
- VBA Sort RossetaCode
- vba string length