Avatar of José Perez
José Perez
Flag for Chile asked on

Error 91 when executing Excel 2003 Macro opened in Internet Explorer 7

I have an excel spreadsheet that works fine if i open it from my desktop or fileserver but it fails to execute if i try to open it from our Intranet, with Internet Explorer.

error'91': Object variable or With block variable not set
Sub SpinButton1_Change()
 
    Dim Url As String
 
    'Tamaño sugerido para las fotos 256 x 192
    On Error GoTo Indice
    Fila = ActiveCell.Row
    SpinButton1.Min = Cells(1, 57).Value
    Dim Foto(500)
    B = Cells(1, 55).Value
    c = 1
    
    Do While c <= Cells(1, 54).Value
    
        Foto(c) = Cells(21 + c, 16).Value
        c = c + 1
    
    Loop
    
    SpinButton1.Max = c - 1
    a = SpinButton1.Value
       
    If 20 >= Fila Then
        Fila = 21
        Range(Cells(Fila + a, 2), Cells(Fila + a, 2)).Select
        F = B + Foto(ActiveCell.Row - 21) + ".jpg"
        Image1.Picture = LoadPicture(F)
        Frame1.Caption = "Registro Nº" + Str(ActiveCell.Row - 21) + "/" + Str(c - 1)
    End If
    
    If SpinButton1.Value > Cells(1, 56).Value Then
        a = 1
    Else
        a = -1
    End If
        
    Range(Cells(Fila + a, 2), Cells(Fila + a, 2)).Select
    F = B + Foto(ActiveCell.Row - 21) + ".jpg"
    'Foto = Foto(ActiveCell.Row - 21) + ".jpg"
    'Image1.Picture = LoadPicture(F)
    'Url = "https://sa.oscar.com/livelinkdav/enterprise/MyProject/General%20Offices/Administration%20Department/Inventario%20Mobiliario/P8170142.jpg"
    Url = F
    Image1.Picture = LoadPictureUrl(Url)
    Frame1.Caption = "Registro Nº" + Str(ActiveCell.Row - 21) + "/" + Str(c - 1)
    
 
 
    
Indice:
    If Err.Number <> 0 Then
 
       MsgBox Err.Number & " " & Err.Description, 16, " Error"
 
    End If
    Cells(1, 56).Value = SpinButton1.Value
End Sub

Open in new window

Microsoft ExcelVisual Basic Classic

Avatar of undefined
Last Comment
José Perez

8/22/2022 - Mon
Rory Archibald

On which line does the error occur?
ASKER CERTIFIED SOLUTION
José Perez

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck