' Sample 17: Excel Part List Report.BAS
'
'This is a completely revid version of the same file renamed to: old_X & Y Part Location Report.bas
'This script has been generated by PowerPCB's VB Script Wizard on 8/23/2007 3:19:25 PM
'It will create reports in Microsoft Excel Format.
'You can u the following code as a skeleton for your own VB scripts
'Array of column names. You can modify it to rename columns
Const Columns = Array("PartType", "RefDes", "PartDecal", "Pins", "Layer", "Orient.", "X", "Y", "SMD", "Glued")
Sub Main
tempFile = DefaultFilePath & "\"
Open tempFile For Output As #1
'Output table header
For i = 0 to UBound(Columns)
OutCell Columns(i)
Next
Print #1
'Output table rows
草船借箭的主人公是谁
军棋翻翻棋For Each part in ActiveDocument.Components
OutCell part.PartType
OutCell part.Name
OutCell part.Decal
OutCell part.Pins.Count
OutCell ActiveDocument.LayerName(part.layer)
ientation
OutCell Format(part.PositionX, "0.000")
OutCell Format(part.PositionY, "0.000")
OutCell Format(part.IsSMD, "Yes/No")
OutCell Format(part.Glued, "Yes/No")
唯美图片大全
Print #1
Next part
Clo #1
ExportToExcel
End Sub
粥的做法大全Sub ExportToExcel
FillClipboard
Dim xl As Object
On Error Resume Next
Set xl = GetObject(,"Excel.Application")
On Error GoTo ExcelError ' Enable error trapping.
If xl Is Nothing Then
Set xl = CreateObject("Excel.Application")
End If
xl.Visible = True
xl.Workbooks.Add
上海站到浦东机场怎么走xl.Range("A:C").NumberFormat = "@"
xl.Range("D1:J1").NumberFormat = "@"
xl.ActiveSheet.Paste
xl.Range("A1:J1").Font.Bold = True
xl.Range("A1:J1").NumberFormat = "@"
xl.ActiveSheet.UdRange.Columns.AutoFit
xl.Range("A1").Select
On Error GoTo 0 ' Disable error trapping.
Exit Sub
ExcelError:
MsgBox Err.Description, vbExclamation, "Error Running Excel"
泡菜煎饼
On Error GoTo 0 ' Disable error trapping.
Exit Sub
End Sub
Sub OutCell (txt As String)
Print #1, txt; vbTab;
End Sub
Sub FillClipboard
' Load whole file to string variable
一根绳上的蚂蚱tempFile = DefaultFilePath & "\"
Open tempFile For Input As #1
L = LOF(1)
AllData$ = Input$(L,1)
Clo #1
'Copy whole data to clipboard
图解风水入门Clipboard AllData$
Kill tempFile
End Sub