ActiveX - MS Office Spreadsheet - How to open specific file?

I've been trying to create an object that will allow me to have a reference spreadsheet open on my desktop. I'm able to get the object with the Microsoft Spreadsheet ActiveX control to be on the desktop, however, I just don't know enough about the script to make it work. As of right now, it won't run and open the specified excel file. Here is the code I entered:

Sub Object_OnScriptEnter
Control.Workbooks.Open Filename:="C:\My Documents\Spare_Brain My Documents\DIPRC.xls"
End Sub

Apparently, " Control.Workbooks.Open Filename:= " is not the correct code because DX tells me it is in error and I have to disable it. Does anyone know how to do this or can point me to a good reference to figure out the correct script to open a specific file?

Thanks,
SCott
1,719 views 3 replies
Reply #1 Top
i am going through the sort of same problem...mine is simple one..i just want to open "my Documents" folder through Vbscript or java when object is being clicked.seems like you know better then me...if you know, be kind and let me know the script.Thanks
Reply #2 Top
Just open the file. Since it is a recognized file type, Excel will open it.... I just re-read your post and that's probably not what you're trying to do. You just want the spreadsheet to open in a control on your desktop, but not with the Excel interface?
Reply #3 Top
You just want the spreadsheet to open in a control on your desktop, but not with the Excel interface?


That's correct. I'd like that Excel file to be open all the time, so I can type into a specific cell the data I want to change. The surounding cells will do a VLookup and grab the other associated data for me to reference. Any idea's? The sample code I placed above does not appear to work.