|
-
Nov 19th, 2001, 07:38 AM
#1
Thread Starter
Hyperactive Member
Help Please Quick Soon Please, I Have A Big Problem
please help I need to inset an excel workbook / sheet into vb and i need to be able to edit it in vb. And be able to run it in vb eg i can click on the macro buttons in excel
please help soon
thanks
-
Nov 19th, 2001, 07:40 AM
#2
Conquistador
You just want to run the excel macro?
-
Nov 19th, 2001, 07:41 AM
#3
Embed an Excel OLE Object on your VB Form.
-
Nov 19th, 2001, 07:43 AM
#4
Thread Starter
Hyperactive Member
i have put an excel ole object but i can click on the buttons in our excel sheet !!!
-
Nov 19th, 2001, 07:45 AM
#5
Conquistador
VB Code:
Dim xlApp As New Excel.Application
Dim xlWb As Excel.Workbook
Set xlWb = xlApp.Workbooks.Open("c:\test.xls")
xlApp.Visible = True
xlWb.Application.Run "MacroName"
xlApp.Quit
Set xlWb = Nothing
Set xlApp = Nothing
Something like that?
-
Nov 19th, 2001, 07:48 AM
#6
Thread Starter
Hyperactive Member
where do i put that in my vb, do i put it in the ole or what, please help,
i am greatfull for all that you do
-
Nov 19th, 2001, 07:52 AM
#7
Conquistador
anywhere
in your code
You have to add a reference to Microsoft Excel Object Library
-
Nov 19th, 2001, 08:02 AM
#8
Thread Starter
Hyperactive Member
it has an error
Dim xlApp As New Excel.Application
Dim xlWb As Excel.Workbook
error >> Set << xlWb = xlApp.Workbooks.Open("c:\test.xls")
xlApp.Visible = True
xlWb.Application.Run "MacroName"
xlApp.Quit
Set xlWb = Nothing
Set xlApp = Nothing
error says invalid outside procedure
-
Nov 19th, 2001, 08:20 AM
#9
Conquistador
Put all that in say
your Form_Load event then
or the click event of a command button.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|