Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default form not opening when started from command line

All,

After searching around I guess that I now can start my Excel app from a
batch file. However, I also need to open a form automatically also. Here is
the code:

Private Sub Workbook_Open()
Dim cmdLine As String
Dim lst() As String
Dim ky As String

Set App = Application
CreateMenus
' Check to see if this is a "scheduled task"
'
cmdLine = GetCommLine (code is elsewhere but it does work)
If Len(cmdLine) = 0 Then Exit Sub
If Not InStr(cmdLine, "/") Then Exit Sub
' Get rid of alerts
'
App.DisplayAlerts = False
' Check out the passed arguments
'
lst = Split(cmdLine, "/")
' Assume we always want the AutoRelease form for now
'
frmRelease.Show (nothing happens)


The form "frmRelease" does not open. Any suggestions?

TIA,

Bill
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default form not opening when started from command line

oops there was a bug in the code - If Not InStr(cmdLine, "/") Then Exit Sub

does not work. I am forever forgetting that "..Not InStr(..." does not do
what it reads as. The form opens just fine.

Sorry about that,

Bill

"Bill Grigg" wrote:

All,

After searching around I guess that I now can start my Excel app from a
batch file. However, I also need to open a form automatically also. Here is
the code:

Private Sub Workbook_Open()
Dim cmdLine As String
Dim lst() As String
Dim ky As String

Set App = Application
CreateMenus
' Check to see if this is a "scheduled task"
'
cmdLine = GetCommLine (code is elsewhere but it does work)
If Len(cmdLine) = 0 Then Exit Sub
If Not InStr(cmdLine, "/") Then Exit Sub
' Get rid of alerts
'
App.DisplayAlerts = False
' Check out the passed arguments
'
lst = Split(cmdLine, "/")
' Assume we always want the AutoRelease form for now
'
frmRelease.Show (nothing happens)


The form "frmRelease" does not open. Any suggestions?

TIA,

Bill

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 launch Macro/Code form command line rpick60 Excel Programming 0 April 5th 09 10:02 PM
Date field in user form & Loading a user form on opening workbook Balan Excel Programming 1 May 24th 08 03:40 PM
opening a worksheet with a command button on a form gbpg Excel Discussion (Misc queries) 2 September 1st 07 05:40 AM
Print an excel file from command line or "cron" type command ??? Chris Salcedo Excel Programming 2 March 28th 07 01:10 AM
Getting started with a User Form Big Chris[_11_] Excel Programming 2 November 5th 03 05:38 PM


All times are GMT +1. The time now is 08:44 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"