Forum Discussion
AlexKaras
15 years agoChampion Level 3
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?
Related Content
- 7 months agosohailalam2696
Recent Discussions
- 6 hours agoMW_Didata
- 17 hours agod_gfleetwood92