Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Have a macro that was quite happy in excel until I added the 'bold' line (which I added because later I need to use sheet4, sheet5 etc.)
Now it fails on the 'set xlsheet bit' with 'object doesn't support this property or method 'xldoc worksheet'
Any ideas please ?
Thanks in advance
Bob
sub weeklyexport
set XLApp = CreateObject("Excel.Application") XLApp.Visible = True
set XLDoc = XLApp.Workbooks.Add
set XLDoc = XLApp.Worksheets.Add
set xlSheet=XlDoc.Woksheets("Sheet1")
xlSheet.Activate
......
end sub
Your bold line changes the XLDoc object from a Workbook object (previous line) to a Worksheet object
You have also misspelled worksheet in the set xlSheet line
Your bold line changes the XLDoc object from a Workbook object (previous line) to a Worksheet object
You have also misspelled worksheet in the set xlSheet line
Thanks Michael - it was the object issue