Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 388
  • Last Modified:

ASP Excel Reading

Dear Friends,

As everybody tries I am trying to read an Excel workbook from an ASP page. The following code works OK but I want to place my Excel Workbook and ASP page at the same folder and want to give a relative path.

Set wb = GetObject("c:\dene.xls")
Set ws = wb.Worksheets(1)
str = ws.Cells(1, 1)
Response.write(str)

how can I use relative path instead of an absolute one ?
0
MacroLand
Asked:
MacroLand
1 Solution
 
Marv-inCommented:
i think you need the absolute path but you can take the relative path and transform it like this

Set wb = GetObject(Server.MapPath("/xlsdir/dene.xls"))
0
 
MacroLandAuthor Commented:
thanks that helped too much
I appreciate your help
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now