excel vba followhyperlink method when no workbook is open -
i created custom ui in excel 2007 part of xlam add-in. custom tab includes button opens website when clicked.
i used thisworkbook.followhyperlink "address"
the add-in password protected causes excel crash whenever click on button while in xlam add-in. works fine when use in .xlsm file.
i think problem in thisworkbook
being password protected. use activeworkbook
instead app crash when there no workbook open.
any suggestions how work around this? (unprotecting file not option)
including information comment + assumption need work when activeworkbook open... try change thisworkbook
activeworkbook
in way this:
sub followinghyperlink() 'check if there open if not activeworkbook nothing activeworkbook.followhyperlink "http://www.stackoverflow.com" else 'if not... depends have , need 'you open new workbook '**this part of code edited** 'or use technique navigate page using ie: dim ieapp set ieapp = createobject("internetexplorer.application") ieapp.visible = true ieapp.navigate "http://www.stackoverflow.com" end if end sub
Comments
Post a Comment