Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default An Excel environment started from a VB script .vbs file.

Orlando and Tim, :)

Sorry for the long delay to REPLY!!! :)

If you remember, the situation involves W95 with Excel97
and Word97,,,,old stuff but usable. Plus, activating
word/excel from a VBS script file and setting/activating
to a specific sheet other than a default sheet at Excel
file open This WorkBook macro code execution.

Also, the issue has been resolved. An Older document on
the Microsoft links (wshobj.doc) was found at the
following:

http://msdn.microsoft.com/scripting/...st/docs/refere
nce/wshobj.doc

This describes the RUN method as opposed to the EXE method
provided in the newer 5.6 version of Scripting. RUN worked
as expected.

Again, sorry for the DELAY in the REPLY and,

THANKS for your Time, Help, and Advise!!!!

Jerry



-----Original Message-----
Set objXl = WScript.CreateObject("EXCEL.application")
objXL.Workbooks.Open "c:\TEST\TEST.xls"
objXL.ActiveWorkbook.RunAutoMacros xlAutoOpen


tim


"Jerry" wrote in message
...
Hello,

Thanks for your Time, Help, and Advise,,,,, :) :)

There are two situations involved:

1. Activation of an Excel97 file (TEST.xls) from

within
a VB Script file (TEST.vbs).

2. The execution of Excel methods in the VBE macro
code placed in the ThisWorkbook area for
the WorkBook Open.

The TEST.vbs file has the following code:

msgbox ("Starting Excel with an *.xls file")
Dim objXL
Set objXl = WScript.CreateObject

("EXCEL.application")
objXL.Workbooks.Open "c:\TEST\TEST.xls"
objXL.Visible = True

The WorkBook Open code in the TEST.xls file for
ThisWorkbook is the following:

Private Sub Workbook_Open()

Worksheets("TestA").Visible = True
Worksheets("TestB").Visible = True
Sheets("TestB").Select
Application.WindowState = xlNormal

End Sub

The Sheets("TestB").Select code in the open will not

make
the TestB sheet the active sheet if the TEST.xls Excel
environment is started by poking on TEST.vbs script

file.

However, when starting the TEST.xls Excel environment by
poking on the TEST.xls file, the Sheets("TestB").Select
will make the TestB sheet the active sheet.

It appears that Excel Object/Methods are not active when
the TEST.xls file is activated from the TEST.vbs code. I
have tried many things in the TEST.xls file VBE macro

but
with no success. There is a lot more logic in the

TEST.xls
file than in the example above that work such as
activating forms, prompting for data inputs, opening
files, creating directories, etc.

Also, I am still learning about many things and the VB
Scripting tool and Objects is a new effort. So, I am

sure
there is probably a simple solution that I just cannot
identify at this time.

Any advise would be TERRRRIFFFICCCCC!!!!!


THANKS for your Time, Help, and Advise!!!! :)

Jerry



.

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
How to do something in an VBS script for all worksheets of an Excel file? Claudia d'Amato Excel Discussion (Misc queries) 9 June 26th 08 10:53 PM
can't save VBA script when saving excel file thinktwice Excel Discussion (Misc queries) 5 December 27th 06 08:38 AM
Excel started, but not the file chengsun Excel Discussion (Misc queries) 0 May 18th 06 06:20 AM
Personal macro file will not pull up when excel is started Tigger Setting up and Configuration of Excel 0 April 28th 06 08:48 PM
Script to save Excel file to the server. raj41977 Excel Discussion (Misc queries) 3 December 8th 05 03:48 PM


All times are GMT +1. The time now is 02:34 PM.

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

About Us

"It's about Microsoft Excel"