View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
dev[_2_] dev[_2_] is offline
external usenet poster
 
Posts: 1
Default SaveAs and relative path

Hello,
I am trying to save a Workbook object using the Excel 9.0 Object library
and VB.Net. I am executing this statement:

oBook.SaveAs(ReportPath & Me.txtFileName.Text)

where 'ReportPath & Me.txtFileName.Text' resolves to '..\Serial
Worksheets\myFile.txt'. This is being saved from an exe in a 'bin'
directory on the same level as the 'Serial Worksheets' directory. Like:

_Project
|_ bin <==exe lives here
|_Serial Worksheets <==workbook should save here

The SaveAs method fails because it is trying to save the workbook up 3
levels from the bin directory where Serial Worksheets does not exist.
Anyone have any ideas what is going on?

TIA,
Steve