|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Specifying text file format
Help please!
I need to take info from an excel spreadsheet and put it into a text file. Ok, but, the text file has to have a specific length and format. How do I specify the text file format from my excel spreaddie ? Any help would be appreciated. |
|
#2
|
|||
|
|||
|
Export Access Tables to Excel Worksheet sample: Application uses DAO to list tables in Access database; you select one table at a time to export to new or existing excel workbook
http://www.freevbcode.com/source/export_excel.zip Export Access Tables to Other Formats Using a SQL Statement sample:You can use a Common Dialog control placed on a form somewhere to use this, or set opnFilename to the complete path and filename with extension. Also you will need to have Microsoft DAO 3.51 or 3.6 referenced. From what I have seen and used so far, the table name must not have spaces in it to do this. I personally just temporarily renamed the table and then used it. 'declare Dim opnFileName As String Dim strTempStr As String Dim tableName As String Dim intFileSep As Integer Dim DatabaseName As Database 'code For intFileSep = Len(opnFileName) To 1 Step -1 If Mid$(opnFileName, intFileSep, 1) = "\" Then Exit For Next intFileSep strTempStr = "SELECT * INTO [dBase IV;DATABASE=" + _ Left$(opnFileName, intFileSep - 1) + "].[" + _ Left$(Right$(opnFileName, Len(opnFileName) - intFileSep), _ Len(Right$(opnFileName, Len(opnFileName) - intFileSep)) - _ 4) + "]" & " FROM ["& tableName &"]" DatabaseName.Execute strTempStr U can see http://forums.devshed.com/showthrea...t=export+access |
|
#3
|
|||
|
|||
|
I usually use CSV (comma seperated values) to move data between Excel and text files and it doesn't matter how long the fields are. Just a thought.
Nick |
|
#4
|
|||
|
|||
|
Yes,nickjc's advice is better!
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > Specifying text file format |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|