This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

(Workflow Script) Edit Excel File within the Object

Former Member
Former Member
Sorry to bother you again, but I need another help from you..

I want to set a Workflow Action, where it should open a File within the Object where Workflow is set. Then it should write something into the Excel Sheet.

I have put some Code together but it doesn't work.. Before I execute the script, I manually check out the object (I didn't manage to check it out via VB).. When I want to check it in again it doesn't do it, I have to undo the Checkout.. Also I don't think the changes were actually made while checked out..


Dim objFiles : Set objFiles = Vault.ObjectFileOperations.GetFiles(objVer)

Set XLS = CreateObject("Excel.Application")
Set WB = XLS.Workbooks.Open(objFiles(1))
Set WS = WB.Sheets(1)
WS.Range("A1").Formula="TEST"

XLS.DisplayAlerts = False
WB.Save
XLS.DisplayAlerts = True
XLS.Quit
Parents
  • Former Member
    Former Member
    I still have this problem so I'm posting a minimal example which doesn't work..


    Dim objExcel : Set objExcel = CreateObject("Excel.Application")
    Dim objWorkBook : Set objWorkbook = objExcel.Workbooks.open("D:\test.xlsx")


    I have this code in a workflow state as Script Action..

    Error:


    "Microsoft Excel cannot access the file [...]. There are several possible reasons [...]"


    If I put the code in a *.vbs file and execute it, it works!

    Can you give me a hint please?
Reply
  • Former Member
    Former Member
    I still have this problem so I'm posting a minimal example which doesn't work..


    Dim objExcel : Set objExcel = CreateObject("Excel.Application")
    Dim objWorkBook : Set objWorkbook = objExcel.Workbooks.open("D:\test.xlsx")


    I have this code in a workflow state as Script Action..

    Error:


    "Microsoft Excel cannot access the file [...]. There are several possible reasons [...]"


    If I put the code in a *.vbs file and execute it, it works!

    Can you give me a hint please?
Children
No Data