Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
ina ina is offline
external usenet poster
 
Posts: 120
Default macro vbscript doesn't run !!! I am desperate! I need help

Hello,

I have a problem with a vbscript code or my vba code I do not know
anymore; my vbscript code it works as I tried to others file and it
executes the macro included but the problem is when I execute one file;
the file.

if I do not execute this scripts my file; the file works well.

what I tried to do it is to open excel and execute one macro in sheet1
and another in sheet2. that's all.

but the macro is estremily compress as I need another programs to
execute it. (cause of some addins such as function for date, currency
and others stuff coming from a specific program) Do you thingk that
the problem can be the addins. I do not know what to do anynmore

this is my code:

<HTML
<HEAD
<SCRIPT LANGUAGE=VBScript
Dim objExcel 'As Excel.Application
Dim objWkB 'As Excel.Workbook
Sub Btn1_onclick()
OpenSheet "getfunctiontest.xls"
End Sub

Sub OpenSheet(strLocation)
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = true
'Application.EnableEvents = True
objExcel.Workbooks.Open(strlocation)
<HTML
<HEAD
<SCRIPT LANGUAGE=VBScript
Dim objExcel 'As Excel.Application
Dim objWkB 'As Excel.Workbook
Sub Btn1_onclick()
OpenSheet "getfunctiontest.xls"
End Sub

Sub OpenSheet(strLocation)
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = true
'Application.EnableEvents = True
objExcel.Workbooks.Open(strlocation)
'objExcel.run objWkB.name &"!"&"thisworkbook.workbook_open"
End Sub
</SCRIPT
<TITLELaunch Excel</Title
</HEAD
<BODY
<INPUT TYPE=BUTTON NAME=Btn1 VALUE="Openfunction Sheet"
</BODY
</HTML

End Sub
</SCRIPT
<TITLELaunch Excel</Title
</HEAD
<BODY
<INPUT TYPE=BUTTON NAME=Btn1 VALUE="Openfunction Sheet"
</BODY
</HTML

any help is appreciated.

thanks

Ina

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default macro vbscript doesn't run !!! I am desperate! I need help

If your code depends on addins, addins are not loaded when open excel using
automation. You have to load them specifically with your code if you want to
use them.

--
Regards,
Tom Ogilvy


"ina" wrote:

Hello,

I have a problem with a vbscript code or my vba code I do not know
anymore; my vbscript code it works as I tried to others file and it
executes the macro included but the problem is when I execute one file;
the file.

if I do not execute this scripts my file; the file works well.

what I tried to do it is to open excel and execute one macro in sheet1
and another in sheet2. that's all.

but the macro is estremily compress as I need another programs to
execute it. (cause of some addins such as function for date, currency
and others stuff coming from a specific program) Do you thingk that
the problem can be the addins. I do not know what to do anynmore

this is my code:

<HTML
<HEAD
<SCRIPT LANGUAGE=VBScript
Dim objExcel 'As Excel.Application
Dim objWkB 'As Excel.Workbook
Sub Btn1_onclick()
OpenSheet "getfunctiontest.xls"
End Sub

Sub OpenSheet(strLocation)
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = true
'Application.EnableEvents = True
objExcel.Workbooks.Open(strlocation)
<HTML
<HEAD
<SCRIPT LANGUAGE=VBScript
Dim objExcel 'As Excel.Application
Dim objWkB 'As Excel.Workbook
Sub Btn1_onclick()
OpenSheet "getfunctiontest.xls"
End Sub

Sub OpenSheet(strLocation)
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = true
'Application.EnableEvents = True
objExcel.Workbooks.Open(strlocation)
'objExcel.run objWkB.name &"!"&"thisworkbook.workbook_open"
End Sub
</SCRIPT
<TITLELaunch Excel</Title
</HEAD
<BODY
<INPUT TYPE=BUTTON NAME=Btn1 VALUE="Openfunction Sheet"
</BODY
</HTML

End Sub
</SCRIPT
<TITLELaunch Excel</Title
</HEAD
<BODY
<INPUT TYPE=BUTTON NAME=Btn1 VALUE="Openfunction Sheet"
</BODY
</HTML

any help is appreciated.

thanks

Ina


  #3   Report Post  
Posted to microsoft.public.excel.programming
ina ina is offline
external usenet poster
 
Posts: 120
Default macro vbscript doesn't run !!! I am desperate! I need help

and do you have any idea how or where can I such information

thank a lot Tom

at least I know a little more now :D

Ina

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default macro vbscript doesn't run !!! I am desperate! I need help

Ina,

You can install add-ins with code like

Application.AddIns("Analysis ToolPak").Installed = True

Change "Analysis ToolPak" to the name that appears in the Add-Ins
dialog box (under the Tools menu).


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"ina" wrote in message
oups.com...
and do you have any idea how or where can I such information

thank a lot Tom

at least I know a little more now :D

Ina



  #5   Report Post  
Posted to microsoft.public.excel.programming
ina ina is offline
external usenet poster
 
Posts: 120
Default macro vbscript doesn't run !!! I am desperate! I need help

thanks Does it work even if my addins is protected?

Ina



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default macro vbscript doesn't run !!! I am desperate! I need help

It should.

--
Regards,
Tom Ogilvy


"ina" wrote:

thanks Does it work even if my addins is protected?

Ina


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Desperate...please help! sas Excel Worksheet Functions 3 January 22nd 06 08:09 PM
VBA Macro Assistance (I am desperate) adncmm1980[_2_] Excel Programming 1 October 4th 04 02:01 PM
VBA Macro Assistance (I am desperate) adncmm1980 Excel Programming 2 October 3rd 04 11:09 PM
How to delete an Excel Macro from VBScript Ram[_3_] Excel Programming 1 September 3rd 03 11:18 PM
Calling xla argumented macro from VBScript Lieven Roelens Excel Programming 2 September 3rd 03 01:45 PM


All times are GMT +1. The time now is 07:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"