Upgrade Warning: Couldn't resolve default property

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
<pre class="prettyprint lang-vb" style=" xlFiles = CreateObject("Scripting.FileSystemObject") UPGRADE_WARNING: Couldnt resolve default property of object objXLApp.Worksheets().Range. Click for more: ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2" intDRow = objXLApp.Worksheets(1).Range("A1").SpecialCells(Microsoft.Office.Interop.Excel.Constants.xlLastCell).row UPGRADE_WARNING: Couldnt resolve default property of object objXLApp.Worksheets().Activate. Click for more: ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"<br/> objXLApp.Worksheets("Charts").Activate() <br/> UPGRADE_WARNING: Couldnt resolve default property of object xlFiles.FileExists. Click for more: ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"<br/> If xlFiles.FileExists(strDirectory & "Excel" & StrFileName & ".xlsm") Then<br/> For iloop = 1 To objXLApp.Workbooks.Count<br/> If objXLApp.Workbooks(iloop).Name = StrFileName & ".xls" Then<br/> objXLApp.Workbooks(StrFileName & ".xlsm").Close(SaveChanges:=False)<br/> Exit For<br/> End If<br/> Next<br/> UPGRADE_WARNING: Couldnt resolve default property of object xlFiles.DeleteFile. Click for more: ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"<br/> xlFiles.DeleteFile(strDirectory & "Excel" & StrFileName & ".xlsm")<br/> End If[/code]
This is in a subroutine in a class, and the class property has:
<pre class="prettyprint" style=" Public objXLApp As Microsoft.Office.Interop.Excel.Application Public xlFiles As Object
[/code]
<br/>

What should I do to fix this?
See the picture below: What I should import to make it a excel worksheet type, instead of system._ComObject type?
<img alt="" src="http://social.msdn.microsoft.com/Forums/getfile/135829 <br/>

Please let me know if there are any questions in my explanation. Thank you for reading!<br/>


View the full article
 
Back
Top