Excel + WSH

I've got this macro in Excel:

Sub Macro3()

    ActiveWorkbook.SaveAs FileName:= _
        "C:\WINNT\Profiles\alexp.000\Personal\test.xls", FileFormat:=xlNormal, _
        Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
        CreateBackup:=False
End Sub

How can I convert this macro to Windows Sripting Host/ASP?  

objXL.ActiveWorkboost.Saveas works, but it doesnt save it with the filename I want... when I try to add the filename variable, it says incorrect syntax...

thanks!
ampxAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

kevinw1Commented:
Did you create a workbook first?

    Dim oXL

    Set oXL = CreateObject("Excel.Application")

    oXL.Workbooks.Add
    oXL.ActiveWorkbook.SaveAs "C:\Data\Excel97\MyFile.xls"

    oXL.Quit

    Set oXL = Nothing

This little snippet worked fine for me. When I removed oXL.Workbooks.Add I do get an error.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ampxAuthor Commented:
Awesome... haha, I tried everything like

oXL.ActiveWorkbook.SaveAs Filename = "C:\Data\Excel97\MyFile.xls"

and a bunch of otherstuff, and it didn't work...  thanks for the tip, works great now...

   
0
kevinw1Commented:
Great! Thanks for the feedback!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Office

From novice to tech pro — start learning today.