I'm unable to create any objects in an Excel macro I am trying to write. Initially I was trying to work with MSXML2.DOMDocument60, however, I realized that i'm not able to get ActiveX to create any objects. For example, I get the same error (Run-time 429 'ActiveX component can't create object') for this line of code:
Dim ExcelSheet As Object
Set ExcelSheet = CreateObject("Excel.Sheet")
Obviously since i'm in excel, the program is installed correctly and it should have access to it. I've checked several other Stackoverflow pages for this. It doesn't appear to be an issue with a reference and I can't imagine the simple code above not working because of missing dlls since I am again already in Excel.
Is there possibly a security feature on my computer blocking this action?
Again, my issue is not with the above code. This was just a simple way to show that Create object is not working.
My main goal is to get the following to work: Dim objXML As MSXML2.DOMDocument60 Set objXML = CreateObject("MSXML2.DOMDocument60")
I've already verified that I have the correct reference and I re-registered the Dlls.
Dim thisWS as Worksheet; Set thisWS = ThisWorkbook.Sheets("Sheet1")- PeterTExcelSheetif you're in Excel? The type library is already referenced, have you tried seenig what happens when you doSet ExcelSheet = New Excel.Worksheet? - Mathieu Guindon