I’m trying to access some Excel files in Visual SourceSafe, check them out, edit them and check them back in all via Python.
After some research online I’ve found some code to help with this process:
import win32com.client
vss = win32com.client.Dispatch(‘SourceSafe6’)
But I immediately get this error:
Traceback (most recent call last):
File “D:\Users\adrian.melian\Desktop\excelCom.py”, line 8, in <module>
vss = win32com.client.Dispatch(‘SourceSafe’)
File “C:\Python27\lib\site-packages\win32com\client_init_.py”, line 95, in Dispatch
dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
File “C:\Python27\lib\site-packages\win32com\client\dynamic.py”, line 114, in _GetGoodDispatchAndUserName
return (_GetGoodDispatch(IDispatch, clsctx), userName)
File “C:\Python27\lib\site-packages\win32com\client\dynamic.py”, line 91, in _GetGoodDispatch
IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch)
pywintypes.com_error: (-2147221005, ‘Invalid class string’, None, None)
[Finished in 0.1s with exit code 1]
What am I doing wrong?
Is “SourceSafe” not the correct way of accessing Visual Source Safe?
I’ve tried accessing Excel with:
excel = win32com.client.Dispatch(‘Excel.Application’)
And that works perfectly.
Thanks for any help!
Best,
Adrian