Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Programmatic export IC BOM (without export dialog) 1

Status
Not open for further replies.

shaccpac

Technical User
Sep 12, 2008
84
I need to export the IC BOM not all of them but by passing critea and i also dont want to pop up export dialog box.

Pls help
 
Have recorded macro but did not see anything except declarations and composition.

Accpac ver 5.6A with MS sql 2005
Pls help
------------------------------------------------------------
Sub MainSub()
'
' Sage Accpac Macro file: D:\Sage\Sage Accpac\Macros\auto.AVB
' Recorded at: Wed Jul 14 16:01:32 2010
'

On Error GoTo ACCPACErrorHandler

' TODO: To increase efficiency, comment out any unused DB links.
Dim mDBLinkCmpRW As AccpacCOMAPI.AccpacDBLink
Set mDBLinkCmpRW = OpenDBLink(DBLINK_COMPANY, DBLINK_FLG_READWRITE)

Dim mDBLinkSysRW As AccpacCOMAPI.AccpacDBLink
Set mDBLinkSysRW = OpenDBLink(DBLINK_SYSTEM, DBLINK_FLG_READWRITE)

Dim temp As Boolean
Dim ICBOM1header As AccpacCOMAPI.AccpacView
Dim ICBOM1headerFields As AccpacCOMAPI.AccpacViewFields
mDBLinkCmpRW.OpenView "IC0200", ICBOM1header
Set ICBOM1headerFields = ICBOM1header.Fields

Dim ICBOM1detail As AccpacCOMAPI.AccpacView
Dim ICBOM1detailFields As AccpacCOMAPI.AccpacViewFields
mDBLinkCmpRW.OpenView "IC0190", ICBOM1detail
Set ICBOM1detailFields = ICBOM1detail.Fields

ICBOM1header.Compose Array(ICBOM1detail, Nothing, Nothing)

ICBOM1detail.Compose Array(ICBOM1header, Nothing, Nothing)



Exit Sub

ACCPACErrorHandler:
Dim lCount As Long
Dim lIndex As Long

If Errors Is Nothing Then
MsgBox Err.Description
Else
lCount = Errors.Count

If lCount = 0 Then
MsgBox Err.Description
Else
For lIndex = 0 To lCount - 1
MsgBox Errors.Item(lIndex)
Next
Errors.Clear
End If
Resume Next

End If

End Sub
 
Ok.

Can you provide some sample code?

Thanks in advance
 
Dim mExport As New AccpacImportExport.ImportExport
mExport.Open a4wLink
mExport.SetView "PM0040", "", VIEW_SEQUENCED_HEADER, Null
mExport.SetView "PM0041", "PM0040", VIEW_DETAIL_SEQUENCED, Null
mExport.SetView "PM0113", "PM0040", VIEW_DETAIL_SEQUENCED, Null
mExport.ExecuteExportScript "MySavedExportScript.XML"

 
Thanks a lot Tuba

I also came to know i need to refer ACCPAC importexport.dll to my project..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top