My computer configuration (Windows Server 2003 + office2003 + visualstudio 2003)
Because some Word documents need to be processed. excel and TXT documents are included in the database. so I found some articles on the Internet about how C # processes office text blocks. there are two important points.
First, the Excel component conversion method:
When I run "tlbimp excel.exe" in DOS, the system prompts that the tlbimp command does not exist.
The command is found below "D:/program files/Microsoft Visual Studio. NET 2003/SDK/V1.1/bin.
C:/program files/Microsoft Office/office11/Excel found in resource manager. copy the EXE file to the Directory D:/program files/Microsoft Visual Studio. NET 2003/SDK/V1.1/bin.
Run "cmd" and run cd d:/program files/Microsoft Visual Studio. NET 2003/SDK/V1.1/bin and then enter tlbimp excel.exe. finally, the Excel file is successfully found. DLL file. The file size is 1064 kb.
The second is to convert the word component method:
When I run "tlbimp excel.exe" in DOS, the system prompts that the tlbimp command does not exist.
1. in resource manager, find "C:/program files/Microsoft Office/office11/winword. EXE "file copy to Directory D:/program files/Microsoft Visual Studio. NET 2003/SDK/V1.1/bin.
2. click Start Menu-run-enter the "cmd" command, and use "cd d:/program files/Microsoft Visual Studio. NET 2003/SDK/V1.1/bin enter the Directory and enter tlbimp winword. EXE. result error. The error message indicates that the type is incorrect.
3. copy "C:/program files/Microsoft Office/office11/MSWord. olb ", go to the directory" ", and then run" tlbimp MSWord. olb. DLL ". the file size is 640 kb.
Third, the access component conversion method:
1. copy "C:/program files/Microsoft Office/office11/msacc. olb ", to the directory" D:/program files/Microsoft Visual Studio. NET 2003/SDK/V1.1/bin,
2. Start Menu-run-enter the "cmd" command and enter the directory with "cd d:/program files/Microsoft Visual Studio. NET 2003/SDK/V1.1/bin ".
3. enter the command "tlbimp msacc. olb, and the result is "ADODB. DLL, Dao. DLL, access. DLL "three files. (If tlbimp msaccess is used. EXE command. will be output with tlbimp winword. the same error of exe. is not a valid type liburary !)
Conclusion: The excel9.0 oolb file is not found after Office2000. The conversion command must be found in the bin folder under the. NET installation directory.