I am having problems creating a MS Excel file from my Visual Basic Application. I keep getting an error when I try to assign a name to a worksheet. The error says ojbect doesn't support this propert or mehtodIM006.
Here is the snippett of code I have to this point:
Dim objXL As Excel.Application
Dim strname As String
Set objXL = CreateObject("Excel.Application"
strname = "Rick"
objXL.Workbooks.Add
With objXL.ActiveWorkbook
.Worksheets.Add
.Worksheets.Name (strname)
End With
objXL.Visible = True
Can someone help? Also if you know of a place with documentation and examples I would appreciate it. I have been searching on MSDN but it doesn't appear to have much information.
Thank you.
Here is the snippett of code I have to this point:
Dim objXL As Excel.Application
Dim strname As String
Set objXL = CreateObject("Excel.Application"
strname = "Rick"
objXL.Workbooks.Add
With objXL.ActiveWorkbook
.Worksheets.Add
.Worksheets.Name (strname)
End With
objXL.Visible = True
Can someone help? Also if you know of a place with documentation and examples I would appreciate it. I have been searching on MSDN but it doesn't appear to have much information.
Thank you.