Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening excel file in IE

Status
Not open for further replies.

bbherman

Programmer
Mar 28, 2007
2
US
Hi,

I have the following code:
Code:
Sub Update()

Dim lab, adate, atime, dum1, dum2 As String
Dim temp, RH As Double

        yr = Year(Now)
        mo = Month(Now)
        dy = Day(Now)
        
     Root = "\\staticbck-ws\labenviro"
     Path = Root & "\" & yr & "\" & mo & "\" & dy & "\" & "FCG Lab.dat"

       Open Path For Input As #1
       Do While Not EOF(1)
         Input #1, aline
          
         adate = Trim(Mid(aline, 17, 15))
         atime = Trim(Mid(aline, 33, 15))
         temp = Val(Trim(Mid(aline, 49, 7)))
         RH = Val(Trim(Mid(aline, 65, 7)))
        
       Loop
       Close #1
        
     Cells(1, 17) = adate & " " & atime
     Cells(2, 17) = temp & " F, " & RH & " RH "
          
End Sub
This code works fine as a stand alone on my desktop, but the spreadsheet this code runs in is opened from a link located in a web page via IE. When I open the file from the link in IE, I get the following error:

Method 'cells' of object_ Global failed.

Any suggestions? Thanks.
 
Have you tried ActiveSheet.Cells(1, 17) ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
ActiveSheet.Cells(1, 17) generates the following error:

object variable or with block variable not set.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top