mtampa
Board Regular
- Joined
- Oct 15, 2007
- Messages
- 61
We have a bunch of automated macro's that run on our computers at night here at work. I am not the person who built them, but simply the last person left in the office who can work with them. I just take old scripts and modify them to what I need, but am not always completely sure what I'm doing.
I'm getting the following error when I try to run my script on the XP machine:
Script: ........xyz
Line: 2
Char: 1
Error: Invalid procedure call or argument
Code: 800A0005
Source: Microsoft VBScript runtime error
It appears to me the part of my scrip the XP comp is getting upset with is the following:
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run ("cm")
wscript.sleep 30000
Dim oAccessApp
Dim oExcelApp
'******************************************************
'****** WINTER 2010 ROOM INVENTORY ******
'******************************************************
Set oAccessApp = CreateObject("Access.Application")
oAccessApp.automationsecurity=1
oAccessApp.visible=true
oAccessApp.OpenCurrentDatabase("\\cgassv0001\revenue\DSS\DBs\Inventory\NAInv_w10.mdb")
oAccessApp.Run ("login")
oAccessApp.Run ("collect_Info_like_winter")
oAccessApp.Quit
wscript.sleep 5000
WshShell.AppActivate("Session A")
WshShell.SendKeys("%{F4}")
It runs just fine on a Win2000 machine, but not the XP machine. Does anyone know what needs to be modified?
Thanks!
I'm getting the following error when I try to run my script on the XP machine:
Script: ........xyz
Line: 2
Char: 1
Error: Invalid procedure call or argument
Code: 800A0005
Source: Microsoft VBScript runtime error
It appears to me the part of my scrip the XP comp is getting upset with is the following:
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run ("cm")
wscript.sleep 30000
Dim oAccessApp
Dim oExcelApp
'******************************************************
'****** WINTER 2010 ROOM INVENTORY ******
'******************************************************
Set oAccessApp = CreateObject("Access.Application")
oAccessApp.automationsecurity=1
oAccessApp.visible=true
oAccessApp.OpenCurrentDatabase("\\cgassv0001\revenue\DSS\DBs\Inventory\NAInv_w10.mdb")
oAccessApp.Run ("login")
oAccessApp.Run ("collect_Info_like_winter")
oAccessApp.Quit
wscript.sleep 5000
WshShell.AppActivate("Session A")
WshShell.SendKeys("%{F4}")
It runs just fine on a Win2000 machine, but not the XP machine. Does anyone know what needs to be modified?
Thanks!