Forum Discussion
AlexKaras
16 years agoCommunity Hero
Hi Anupa,
This is quite strange that Sys.OleObject() causes problems... Actually, I don't think that this is because of it...
Though you may consider another possible workaround: create the needed command; copy it into clipboard; paste into cmd window; press Enter.
Something like this (VBScript, untested):
strCmd = "c:"
Sys.Clipboard = strCmd
Command_Prompt_Window.Keys("~[Space]ep") ' Alt-Space -- Edit -- Paste
Command_Prompt_Window.Keys("[Enter]")
strCmd = "cd ""\Program Files\Microsoft Office\Office12"""
Sys.Clipboard = strCmd
Command_Prompt_Window.Keys("~[Space]ep") ' Alt-Space -- Edit -- Paste
Command_Prompt_Window.Keys("[Enter]")
strCmd = "Excel.Exe ""D:\BookMark.xlsx"""
Sys.Clipboard = strCmd
Command_Prompt_Window.Keys("~[Space]ep") ' Alt-Space -- Edit -- Paste
Command_Prompt_Window.Keys("[Enter]")
Does this work?
This is quite strange that Sys.OleObject() causes problems... Actually, I don't think that this is because of it...
Though you may consider another possible workaround: create the needed command; copy it into clipboard; paste into cmd window; press Enter.
Something like this (VBScript, untested):
strCmd = "c:"
Sys.Clipboard = strCmd
Command_Prompt_Window.Keys("~[Space]ep") ' Alt-Space -- Edit -- Paste
Command_Prompt_Window.Keys("[Enter]")
strCmd = "cd ""\Program Files\Microsoft Office\Office12"""
Sys.Clipboard = strCmd
Command_Prompt_Window.Keys("~[Space]ep") ' Alt-Space -- Edit -- Paste
Command_Prompt_Window.Keys("[Enter]")
strCmd = "Excel.Exe ""D:\BookMark.xlsx"""
Sys.Clipboard = strCmd
Command_Prompt_Window.Keys("~[Space]ep") ' Alt-Space -- Edit -- Paste
Command_Prompt_Window.Keys("[Enter]")
Does this work?