Emohawk
What a wicked mullet...
- Local time
- Today, 08:42
- Joined
- Mar 14, 2002
- Messages
- 79
Hi Folks,
My first foray into Excel Spreadsheet creation has hit a snag.
I can create the spreadsheets and populate them with data as required however for some reason VBA does not recognise
.SaveAs as a valid action. Funnily enough even when I try to get a list of available actions from any Object type nothing comes up!
Any ideas as to what I'm doing wrong?
My code follows...
My first foray into Excel Spreadsheet creation has hit a snag.
I can create the spreadsheets and populate them with data as required however for some reason VBA does not recognise
.SaveAs as a valid action. Funnily enough even when I try to get a list of available actions from any Object type nothing comes up!
Any ideas as to what I'm doing wrong?
My code follows...
Code:
Dim objXl, objWkb, objSht As Object
Set objXl = CreateObject("Excel.Application")
objXl.Visible = True
Set objWkb = objXl.Workbooks.Add
Set objSht = objWkb.Worksheets.Add
Select Case ReportType
Case "ODP"
AddODPHeaders objSht
Case "SDS"
AddSDSHeaders objSht
Case "SPV"
AddSPVHeaders objSht
End Select
'.SaveAs is in capitals as VBA doesn't recognise it... ARGH!!!!
objSht.SAVEAS = "G:\S.O.S\" & ReportType & ".xls"
Set objXl = Nothing
Set objWkb = Nothing
Set objSht = Nothing
Last edited: