A little help in programming docx to Excel

Click For Summary

Discussion Overview

The discussion revolves around the feasibility and methods of automating the extraction of data from multiple DOCX files into an Excel spreadsheet. The participants explore programming solutions, primarily using Visual Basic for Applications (VBA), to facilitate this process.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant seeks guidance on how to automatically fetch names and numbers from DOCX files into Excel, expressing limited programming knowledge.
  • Another participant asks for clarification on the format of the data within the DOCX files, suggesting that the structure could impact the extraction process.
  • Concerns are raised about the potential size of the data and the implications of storing it in Excel, with suggestions that a database might be more appropriate for larger datasets.
  • A participant mentions the existence of a resource that outlines steps for transferring Word form data to Excel, contingent on the forms being filled out locally.
  • There is a suggestion that it may be possible to program a single Excel file to fetch data from all documents in a specified folder without opening each document individually.
  • Another participant provides a code snippet that demonstrates how to search for Word files in a directory, indicating that it is feasible to automate the data retrieval process.
  • A request for further assistance is made by a participant who is unsure about how to implement the programming needed to extract the data.

Areas of Agreement / Disagreement

Participants generally agree that it is possible to automate the data extraction process, but there are differing views on the best approach and the implications of handling large datasets. The discussion remains unresolved regarding the specific implementation details and the most efficient method to achieve the desired outcome.

Contextual Notes

Limitations include the uncertainty about the data format within the DOCX files and the potential challenges associated with handling large amounts of data in Excel versus a database.

jmex
Messages
59
Reaction score
3
Hello all,

i don't have much knowledge about programming so i googled about fetching datas from docx to excel and it showed can be done by VB. I see under developer tab in excel and opened Macros where i can write programmes.
Now i have many docx files in my folder and daily it is increased by one or two. I want my excel to fetch data from it automatically. Is it possible? If yes then how can i do it?
In the document i have names and numbers written. How can i do it? If not excel then access file is also good.
Kindly help.

Thanks,
 
Technology news on Phys.org
What format do the names and numbers have?
Are they tab separated, space separated, ...?

Another practical question, does this continue indefinitely? Because depending on the amount of names those files will become HUGE depending on the amount of records in each file and whether or not you delete them once your script runs. (caution is warranted because it could break when the format of the data changes resulting in a loss of data)
Depending on the number of records it would be good to look at other ways to store them than an excel file (e.g. a database).
 
thank you so much for your reply,
I have a word that has only text box i believe in which i have to fill up data. Below is the screen shot
i don't know but i can't edit or click on any other written data except write inside box.
upload_2016-9-23_10-12-21.png

I can't do anything else except writing inside the box and i only want to fetch the written data. So is it possible?

Thanks,
 

Attachments

  • upload_2016-9-23_10-12-10.png
    upload_2016-9-23_10-12-10.png
    1.7 KB · Views: 510
Do you think this is what you want to do? http://www.techrepublic.com/blog/10...ransferring-word-form-data-to-an-excel-sheet/

It seems that it does what you want if(!) the form is filled locally. (You could call the macro they give at the moment they save although this might lead to double records)

In case you receive these forms daily I'll have to check out some more stuff.
A good idea could be to convert the forms to textfiles in a certain format (CSV, tab separated, ...) but I'm not immediately certain how this is done quickest/best.
 
  • Like
Likes   Reactions: Pepper Mint
Thank you for replying. I have read the process but the problem is i have to open every document and program it. Instead is it possible to program a single excel file so that it can fetch all the data from documents available in the folder?
 
jmex said:
Thank you for replying. I have read the process but the problem is i have to open every document and program it. Instead is it possible to program a single excel file so that it can fetch all the data from documents available in the folder?
Yes, definitely possible! you would have to write Subs or Functions to look up Word files in a specific directory then process each of them to get the output data.

For example, searching C drive for Word document files.
Code:
Dim ofs As Office.FileSearch
Dim i As Integer
Set ofs = Application.FileSearch

With ofs
    .NewSearch
    .FileType = msoFileTypeAllFiles
    .Filename = "*.doc"
    .LookIn = "C:\"
    .SearchSubFolders = True
    .Execute
End With
 
  • Like
Likes   Reactions: jmex
Thank you Pepper Mint. can you help me to fetch the datas written inside all the documents? I don't know much about programming.
 

Similar threads

  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 14 ·
Replies
14
Views
1K
  • · Replies 43 ·
2
Replies
43
Views
8K
  • · Replies 22 ·
Replies
22
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
Replies
19
Views
4K
Replies
5
Views
2K
  • · Replies 18 ·
Replies
18
Views
6K