Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default SaveAs and relative path

Hi Dev,

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?


I think the ReportPath will need to be a fully-qualified path, not a
relative one.

Regards

Stephen Bullen
Microsoft MVP - Excel
www.BMSLtd.co.uk


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default SaveAs and relative path

Thanks!

"Stephen Bullen" wrote in message
...
Hi Dev,

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?


I think the ReportPath will need to be a fully-qualified path, not a
relative one.

Regards

Stephen Bullen
Microsoft MVP - Excel
www.BMSLtd.co.uk




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Relative Path in Connection String Breunus Excel Discussion (Misc queries) 2 July 29th 09 05:10 PM
Relative Path to a Folder Heliocracy Excel Discussion (Misc queries) 3 October 3rd 07 04:28 PM
how to change absolute path to relative path hwijgerse Excel Worksheet Functions 0 November 25th 05 07:18 AM
Absolute vs Relative path K2H Excel Discussion (Misc queries) 2 July 28th 05 12:50 PM
relative path. Bob Kilmer Excel Programming 0 September 12th 03 12:25 AM


All times are GMT +1. The time now is 11:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"