Discussion:
Is it possible to embed vbscript in excel?
(too old to reply)
l***@gmail.com
2007-03-05 01:58:58 UTC
Permalink
I've got a script that calculates some data from a spreadsheet, and
stores it in a new sheet. It then generates several chart sheets.

I was wondering if it is possible to embed the script in Excel, or add
it to an excel spreadsheet and be able to execute it from there?

Thanks

Lionel.
Jim Cone
2007-03-05 03:32:22 UTC
Permalink
In Excel...
Alt + F11 exposes the Visual Basic Editor.
Insert (menu) | Module inserts a module.
Copy and paste the code into the module.
F5 key runs the code.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



<***@gmail.com> wrote in message
I've got a script that calculates some data from a spreadsheet, and
stores it in a new sheet. It then generates several chart sheets.
I was wondering if it is possible to embed the script in Excel, or add
it to an excel spreadsheet and be able to execute it from there?
Thanks
Lionel.
l***@gmail.com
2007-03-05 04:31:26 UTC
Permalink
That sounds like what I want. Thanks I'll start playing :).
Post by Jim Cone
In Excel...
Alt + F11 exposes the Visual Basic Editor.
Insert (menu) | Module inserts a module.
Copy and paste the code into the module.
F5 key runs the code.
--
Jim Cone
San Francisco, USAhttp://www.realezsites.com/bus/primitivesoftware
I've got a script that calculates some data from a spreadsheet, and
stores it in a new sheet. It then generates several chart sheets.
I was wondering if it is possible to embed the script in Excel, or add
it to an excel spreadsheet and be able to execute it from there?
Thanks
Lionel.
E C H (He of too much code)
2007-03-05 13:37:21 UTC
Permalink
This then becomes VBA, which does have some minor differences. Their are groups
for this.
Post by l***@gmail.com
That sounds like what I want. Thanks I'll start playing :).
urkec
2007-03-05 16:17:10 UTC
Permalink
You can also add a CommandButton to the spreadsheet and add code to execute
the script when you click the button

Private Sub CommandButton1_Click()
Shell "Wscript C:\MyScript.vbs", vbNormalFocus
End Sub
--
urkec
Post by l***@gmail.com
That sounds like what I want. Thanks I'll start playing :).
Post by Jim Cone
In Excel...
Alt + F11 exposes the Visual Basic Editor.
Insert (menu) | Module inserts a module.
Copy and paste the code into the module.
F5 key runs the code.
--
Jim Cone
San Francisco, USAhttp://www.realezsites.com/bus/primitivesoftware
I've got a script that calculates some data from a spreadsheet, and
stores it in a new sheet. It then generates several chart sheets.
I was wondering if it is possible to embed the script in Excel, or add
it to an excel spreadsheet and be able to execute it from there?
Thanks
Lionel.
LJB
2007-03-05 14:28:42 UTC
Permalink
Post by Jim Cone
In Excel...
Alt + F11 exposes the Visual Basic Editor.
Insert (menu) | Module inserts a module.
Copy and paste the code into the module.
F5 key runs the code.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
I've got a script that calculates some data from a spreadsheet, and
stores it in a new sheet. It then generates several chart sheets.
I was wondering if it is possible to embed the script in Excel, or add
it to an excel spreadsheet and be able to execute it from there?
Thanks
Lionel.
Very closely related is what I used to use to open Excel hidden with the VBA
editor only visible. It added a context menu item to vbs files and made them
very easy to edit. (Unfortunately it no longer works for me so perhaps
someone here could help me fix it for XP and Office 2000.)

http://groups.google.com/group/microsoft.public.scripting.vbscript/msg/47eae3bddee0f47e

thanks
LJB
Loading...