Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '----------------------------------------------
- ' Macro to use runSHUTTLE addin with code
- '----------------------------------------------
- Sub RunSHUTTLEfile()
- '
- ' RunSHUTTLEfile Macro
- '
- Dim runSHUTTLEAddin, AddinObject
- On Error GoTo ErrHandler
- ' GET ADDIN OBJECT FROM EXCEL
- Set runSHUTTLEAddin = Application.COMAddIns.Item("TxRunner.AddinModule")
- If runSHUTTLEAddin Is Nothing Then
- MsgBox "Unable to initialize object of runSHUTTLE addin"
- Exit Sub
- End If
- ' Get com object from addin object
- Set AddinObject = runSHUTTLEAddin.Object.TsMacros
- If runSHUTTLEAddin Is Nothing Then
- MsgBox "Unable to initialize com object of runSHUTTLE addin"
- Exit Sub
- End If
- ' Set the type of run from the following
- ' RunNow = 0,
- ' RunOnErrors = 1,
- ' StepByStep_StopOnAllScreens = 2,
- ' StepByStep_StopOnErrors = 3
- AddinObject.TypeofRun = 0
- ' Set the Run On Rows from the following
- ' AsInShuttleFile = 0, // rows as in SHUTTLE file
- ' Selected = 1, // selected rows on active excel sheet
- ' Filtered = 2 // filtered rows on active excel sheet
- AddinObject.RunOnRows = 1
- Dim strShuttleFile As String
- ' open existing SHUTTLEfile to Run
- strShuttleFile = "C:Users310274697DocumentsWinShuttleTRANSACTIONTRANSACTION scriptsCreation of Materials Scripts2017.11.21 ZMM01U creation of materials BR9V.txr"
- AddinObject.OpenShuttleFile (strShuttleFile)
- AddinObject.StartRow = 2
- AddinObject.EndRow = 3
- AddinObject.LogColumn = "E"
- 'Change ALF path as per requirement and accessibility of file.
- 'Change Sheet where data can be written
- 'AddinObject.SheetName = "Sheet3"
- 'AddinObject.AlfPath = "C:USERSSASINGHDOCUMENTSWINSHUTTLETRANSACTIONALFWE6800_ANKUR.ALF"
- 'AddinObject.ResultFileName = "C:UsersSASINGHDocumentsWinshuttleTRANSACTIONDataCopy of Abs-ldcvb.xlsx"
- ' Call the Run Function to start uploading data
- AddinObject.Run
- Exit Sub
Add Comment
Please, Sign In to add comment