Vb.net program crashing since 2015

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everyone,
I made a standalone .exe using vb.net and it keeps crashing since I'm using autocad 2015. My program use to export a face from inventor to a .dwg and add some lines of text. It still works on workstation where autocad 2013 is still use, but on my station, I only have 2015 and it's not working. Do you guys have any idea why? here is a bit of code:
Dim oACAD As New Object
oACAD = CreateObject("AutoCAD.Application")
oACAD.visible = False
lblStatus.Text = "Ouverture d'Autocad en cours..."
oACAD.Documents.Open(fileNameAndPath, False)
Dim oDoc As AutoCAD.AcadDocument
oDoc = oACAD.ActiveDocument <--- I get an error on this line : 0x80004002 (E_NOINTERFACE)). ... Unable to cast
Complete error message (sorry but my OS is in french but I think you can get the point)
System.InvalidCastException was unhandled
HResult=-2147467262
Message=Impossible d'effectuer un cast d'un objet COM de type 'System.__ComObject' en type d'interface 'AutoCAD.AcadDocument'. Cette opération a échoué, car l'appel QueryInterface sur le composant COM pour l'interface avec l'IID '{849850B8-84BA-44A4-ADF5-C7FE74F111FC}' a échoué en raison de l'erreur suivante : Cette interface n’est pas prise en charge (Exception de HRESULT : 0x80004002 (E_NOINTERFACE)).
Source=RexLaser