When the user clicks a button I want to create an instance of Excel and display the Open dialog box set to a specific subdirectory. This will give the user a choice of opening one of many spreadsheets in this directory. When I run the following code (the user clicks button1) I get the error, "ActiveX component can't create object :'Excel.Application'". What am I missing?
<SCRIPT LANGUAGE=vbscript>
<!--
Sub button1_onclick()
Set oExcel = CreateObject("Excel.Application"
oExcel.Visible = True
Set fd = oExcel.FileDialog(msoFileDialogFilePicker)
fd.InitialFileName = "\\cc-nts2\data\accounting\"
fd.Filters.Add "*.xls", "*.xls", 1
fd.FilterIndex = 2
fd.AllowMultiSelect = False
If fd.Show = -1 Then
oExcel.Workbooks.Open fd.SelectedItems(1)
End If
Set fd = Nothing
Set oExcel = Nothing
End Sub
-->
</SCRIPT>
Randy Carr
randy.carr@carteretcraven.ncemcs.com
<SCRIPT LANGUAGE=vbscript>
<!--
Sub button1_onclick()
Set oExcel = CreateObject("Excel.Application"
oExcel.Visible = True
Set fd = oExcel.FileDialog(msoFileDialogFilePicker)
fd.InitialFileName = "\\cc-nts2\data\accounting\"
fd.Filters.Add "*.xls", "*.xls", 1
fd.FilterIndex = 2
fd.AllowMultiSelect = False
If fd.Show = -1 Then
oExcel.Workbooks.Open fd.SelectedItems(1)
End If
Set fd = Nothing
Set oExcel = Nothing
End Sub
-->
</SCRIPT>
Randy Carr
randy.carr@carteretcraven.ncemcs.com