Asked by duncanb7
at 2024-06-17 08:50:04
Point:500 Replies:7 POST_ID:828346USER_ID:11059
Topic:
Microsoft Excel Spreadsheet Software;;
I've some questions about IE in VBA at Excel 2003 ,
Question-1, When I'm doing development VBA code in Excel to connect to website through suchas similar codeas follows
set IE= new InternetExplorer
.navigate "http:example.com"
............
We need it works we need to change some setting in IE window at tool menu and internet option and select Security tab and
uncheck "Enable Protected Mode" before running VBA code,, otherwise it could not connect to internet.
I want to know could we be able to set those setting in VBA code with our main VBA program together ?The reason is that sometimes we forget to set/enable or check back "Enable Protected Mode" after we have finished our VBA program job that will
be danager and easily to get virus from disabling "Enable Protected Mdoe", RIght ? The best is vba program code could
be enable the mode after the code is running completely or done .
Question-2, During debugging and developement for our VBA code, it always happen we will do something wrong such as
wrong coding or forget to quit the IE object in the code after use and easily to get autmation handler errorby syntax error
. And most likely that will be esaily to hang up Window IE program, and it won't be able to start up IE windows again through VBA code. Even we exit VBA program and Excel application and re-run the prgoram code, it still could not startup the IE by navigate , and even re-startup the IE at windows but it did not startup again. Unless we re-start up the computer. Probably, What I make mistake is accidentally to change the Registry Key of IE during VBA programming i guess ,
it there any ways we could solve this out without re-start the computer ? Which key I could repair it if I run regedit command at C: .. hope you will understand my two questions, if not, let me know .
Please advise
Duncan
Question-1, When I'm doing development VBA code in Excel to connect to website through suchas similar codeas follows
set IE= new InternetExplorer
.navigate "http:example.com"
............
We need it works we need to change some setting in IE window at tool menu and internet option and select Security tab and
uncheck "Enable Protected Mode" before running VBA code,, otherwise it could not connect to internet.
I want to know could we be able to set those setting in VBA code with our main VBA program together ?The reason is that sometimes we forget to set/enable or check back "Enable Protected Mode" after we have finished our VBA program job that will
be danager and easily to get virus from disabling "Enable Protected Mdoe", RIght ? The best is vba program code could
be enable the mode after the code is running completely or done .
Question-2, During debugging and developement for our VBA code, it always happen we will do something wrong such as
wrong coding or forget to quit the IE object in the code after use and easily to get autmation handler errorby syntax error
. And most likely that will be esaily to hang up Window IE program, and it won't be able to start up IE windows again through VBA code. Even we exit VBA program and Excel application and re-run the prgoram code, it still could not startup the IE by navigate , and even re-startup the IE at windows but it did not startup again. Unless we re-start up the computer. Probably, What I make mistake is accidentally to change the Registry Key of IE during VBA programming i guess ,
it there any ways we could solve this out without re-start the computer ? Which key I could repair it if I run regedit command at C: .. hope you will understand my two questions, if not, let me know .
Please advise
Duncan