Guest User

Untitled

a guest
Oct 22nd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. >Traceback (most recent call last):
  2. File"mypathtopythonprogram", line 19, in <modlule>
  3. xl.Application.Run('main')
  4. File"mypathAppDataLocalTempgen_py3.70020813-0000-0000-C000-000000000046x0x1x9_Application.py", line 376, in Run
  5. , Arg26, Arg27, Arg28, Arg29, Arg30
  6. File"mypathAppDataLocalProgramsPythonPython37-32libsite-packageswin32comclient__init__.py", line 467, in _ApplyTypes_
  7. self._oleobj_.InvokeTypes(dispid, 0, wFlags, retType, argTypes, *args),
  8. pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, None, None, None, 0, -2146788248), None)
  9.  
  10. import win32com.client
  11. import win32com
  12. import os, os.path
  13.  
  14. xl = win32com.client.gencache.EnsureDispatch("Excel.Application")
  15. xl.Workbooks.Open(Filename=r"mypathDesktopWorksWithPy.xlsm")
  16. xl.Visible = True
  17. xl.Workbooks(1).Worksheets(1).Cells(4, 7).Value = r"17639d0c-2007-4a68-a0fd0b615d6f8fed"
  18. xl.Workbooks(1).Worksheets(1).Cells(7, 7).Value = r'\localserveraddress'
  19. xl.Application.Run(r'main')
  20. xl.Workbooks(1).SaveAs(Filename=r'mypathDesktopsameFileButWithDesiredResults.xlsm', FileFormat=52)
  21. xl.Workbooks(1).Close(0)
  22. xl.Quit()
Add Comment
Please, Sign In to add comment