excel - Different behavior in VBA when in debug mode (steps) or in automatic mode -


i have excel macro makes hyperlinks in first column of table.

when run step step in manual mode, works fine , hyperlinks created.

when run in automatic mode, runs without error hyperlinks not created.

i not have ideas why...?

public sub aktualisieren()      call column_makehyperlinks(1)  end sub 

and then

    sub column_makehyperlinks(blatt)      ' ### start tabellenanalyse ###     '   - länge     '   - start     '   - ende      on error resume next     set ws = sheets(blatt) '     set tabelle = ws.listobjects(1) ' table       anzahl = tabelle.listrows.count ' number of rows in table     start = tabelle.listrows(1).range.row ' first row in table     ende = tabelle.listrows(tabelle.listrows.count).range.row ' last row in table      smsg = "there " & anzahl & " rows in '" & tabelle.name & "'. "     smsg = smsg & dnl & "start in row " & start     smsg = smsg & nl & ", ende in row " & ende     'msgbox smsg, vbinformation, ucase(stablename) ' activate text-output      ' ### ende tabellenanalyse ###      irow = start ' start @ first row content     icol = 1 ' column      ' parameters, should concatenated link in column     ws.hyperlinks.delete      while ws.cells(irow, icol).value <> ""         ' create hyperlink (fixed prefix , dynamic parameter         temp = ws.cells(irow, icol).value         'ws.cells(irow, icol).select ' not necessary, make active cell visible in manual mode         ws.hyperlinks.add anchor:=ws.cells(irow, icol), address:="https://www.google.de/?gws_rd=ssl#q=" & activesheet.cells(irow, icol).value, _         texttodisplay:=temp, _         screentip:="https://www.google.de/?gws_rd=ssl#q=" & activesheet.cells(irow, icol).value          'move next row         irow = irow + 1     loop   end sub 

can explain me why? in advance!

for me code works, hyperlinks created, seem "inactive". added:

    ws.cells(irow, icol).value = ws.cells(irow, icol).value 

before irow increment solved problem of hyperlinks "activity".
way iterate through cells of listobject's column should rather like:

for each c in tabelle.listcolumns("column_name").databodyrange     temp = c.value     ws.hyperlinks.add anchor:=c, address:="https://www.google.de/?gws_rd=ssl#q=" & c.value, _     texttodisplay:=temp, _     screentip:="https://www.google.de/?gws_rd=ssl#q=" & c.value     c.value = c.value next 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -