Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to fatch Range's from an excel sheet when the file is on netwo
hi All
i write a function to find the Ranges in excel sheet.My excel sheet shoul be on network. i map that path from my local machine. now when we publish my site a want to find the range of that excel sheet it shows " Object variable or with Block bariable not set." Tthis is my function--where Filename -Z:\inventory.xls, Z:\ is my map Drived from server. Friend Function GetExcelRange(ByVal Filename As String) Dim ExcelAPP As Object Dim inc As Integer = 0 Dim RangeString As New StringBuilder Try ExcelAPP = CreateObject("Excel.Application") ExcelWorkBook = ExcelAPP.Workbooks.Open(Filename:=Filename) ExcelSheet = ExcelWorkBook.Worksheets If ExcelWorkBook.Names.Count = 0 Then MsgBox("Error: No name ranges in this excel file", MsgBoxStyle.Critical, "Metamation") Return RangeString.ToString() End If While Not inc = ExcelWorkBook.Names.Count If inc = 0 Then RangeString.Append(ExcelWorkBook.Names.Item(inc + 1).Name) Else RangeString.Append("," & ExcelWorkBook.Names.Item(inc + 1).Name) End If inc += 1 End While Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Critical, "Metamation") Finally ExcelAPP.ActiveWorkbook.Close() ExcelAPP.Quit() ExcelAPP = Nothing End Try Return RangeString.ToString() End Function |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Need to link PDF file into excel document for someone not on netwo | Excel Discussion (Misc queries) | |||
How can I copy range's style to another in Excel? | Excel Programming | |||
questions regarding range's | Excel Discussion (Misc queries) | |||
questions regarding range's | Excel Discussion (Misc queries) | |||
how is possible working on work sheet by two person in the netwo. | Excel Worksheet Functions |