LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default RunAutoMacros does not work correctly from vbscript!

Hi

I create an Excel workbook through vbscript:
Set objXL = WScript.CreateObject("Excel.Application")
objXL.Visible = TRUE
set objWkB = objXL.WorkBooks.add( "book.xlt" )

After creating I pass the parameters into the first
worksheet:
Set colArgs = WScript.Arguments
For i = 0 to colArgs.Count - 1
objXL.Cells(i + 1, 1).Value = "Parameter(" & i & ")"
objXL.Cells(i + 1, 2).Value = colArgs(i)
Next

After this I try to run "Open" macro by command:
objXL.WorkBooks.Item(1).RunAutoMacros(1)

Problem is that the autoOpen subroutine is called right
after workbook.add command when there are no parameters
on the worksheet.
When .RunAutoMacros command is executed the control never
passes to autoOpen subroutine!

I have Win XP with latest updates and Office 2000 with
SP3.

Does anyone have a solution to this.

Juha
 
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
countif on cells with formula's won't work correctly JusMe Excel Worksheet Functions 21 August 16th 08 08:20 AM
SMALL function seems not to work correctly hdf Excel Worksheet Functions 13 February 16th 08 02:38 PM
Sorting numbers doesn't work correctly GrammyEmmy New Users to Excel 8 June 25th 06 11:45 PM
How do I get Auto-Fit to work correctly? Mickey Dunne Excel Worksheet Functions 0 May 11th 06 01:47 AM
custom filter does not work correctly RJ Excel Discussion (Misc queries) 1 September 9th 05 07:34 PM


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