PDA

View Full Version : Inventory import bug(s) & Macro


chrismc
10-02-2002, 11:36 AM
For those of you attempting to import inventory in V13 here's a few problems:
1. The "Import File Specification" on pages 497-499 in the Peachtree Classic User's Guide Volume 1 is incorrect. It took me a while (okay a long while) to figure out what was wrong. The format is correct with the exception of the 3 fields named "Field". You need to delete each of these in order for the import to work.
2. There is a confirmed bug in the import process that fails to import any "Quantity Price" or "Quantity Level" entries (Quantity Level 1, Quantity Price 1, etc). The control report states that the items were changed, however they don't show up in "Maintain Inventory Items". I'm still not sure if they are actually imported and the bug is in the display within "Maintain Inventory Items", or if the bug is in the control report reporting that they were imported when they are not. Peachtree has repoduced this problem and is working on it. I asked to be notified when it's fixed but they said it might be a service release thing, so it may be a few months before it's fixed. If I hear back sooner, I'll update this post.
3. If you import any items into inventory that contain spaces, the spaces will be removed. For instance 'Chris was here' was the description of an inventory item, it will be imported as Chriswashere. You can put " " around these items to prevent this, which is quite time consuming for a large import. I found an excel macro that will put quotes around all the selected fields and export the data into a .CSV file in one pass. I didn't write it, but it works well. Here's the code. Just create a new marco and paste the code into it. I was using Excel 2000.

Sub QuoteCommaExport()
' Dimension all variables.
Dim DestFile As String
Dim FileNum As Integer
Dim ColumnCount As Integer
Dim RowCount As Integer

' Prompt user for destination file name.
DestFile = InputBox("Enter the destination filename" _
& Chr(10) & "(with complete path):", "Quote-Comma Exporter")

' Obtain next free file handle number.
FileNum = FreeFile()

' Turn error checking off.
On Error Resume Next

' Attempt to open destination file for output.
Open DestFile For Output As #FileNum

' If an error occurs report it and end.
If Err <> 0 Then
MsgBox "Cannot open filename " & DestFile
End
End If

' Turn error checking on.
On Error GoTo 0

' Loop for each row in selection.
For RowCount = 1 To Selection.Rows.Count

' Loop for each column in selection.
For ColumnCount = 1 To Selection.Columns.Count

' Write current cell's text to file with quotation marks.
Print #FileNum, """" & Selection.Cells(RowCount, _
ColumnCount).Text & """";

' Check if cell is in last column.
If ColumnCount = Selection.Columns.Count Then
' If so, then write a blank line.
Print #FileNum,
Else
' Otherwise, write a comma.
Print #FileNum, ",";
End If
' Start next iteration of ColumnCount loop.
Next ColumnCount
' Start next iteration of RowCount loop.
Next RowCount

' Close destination file.
Close #FileNum
End Sub

See ya!

Chris

chrismc
02-13-2003, 08:51 AM
#2 above has been fixed in version 13.02.

Chris