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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA(excel) - How to set the path of application

Status
Not open for further replies.

baltog

Programmer
Dec 19, 2002
22
0
0
US
Hi,

Can u help me how to set the path for my excel application?

Private xlSrcApp As Excel.Application
Private xlSrcBook As Excel.Workbook
Private xlSrcSheet As Excel.Worksheet

How do i set the path or source for xlSrcApp?

tnx in advance,

Rodel
 
' I am unsure what you mean.
' Anyway, see the following:


With xlSrcApp
Debug.Print .DefaultFilePath ' read/write
Debug.Print .AltStartupPath ' read/write
Debug.Print .LibraryPath ' read-only
Debug.Print .NetworkTemplatesPath ' read-only
Debug.Print .StartupPath ' read-only
Debug.Print .TemplatesPath ' read-only
Debug.Print .Path ' read-only
End With

' or

ChDrive "I:"
ChDir "I:\temp\delme"

' or (if you are using VB6 as the optional "servername" argument is not available in Excel/word 97 but might be in later versions)

Set xlSrcApp = CreateObject("Excel.Application", "YourServer")

' see
 
Hi Justin,

Here's the problem. I want to copy the data from one excel file to another excel file. I already have done the destination file which im created using filesystemobject in my code. Before im getting data to be copied in the destination file from one excel file but in this case i used recordset. I used the path of the excel file(source file) as datasource of the recordset. THis is working already but it came to another problem. The recordset is holding only 255 chars but some cell in the source file is holding more than 255 chars. So i have come to an idea that i should copy the data from cell to cell. From Source file to another file. Question: How do i activate the source file which is existing. Let say: C:\SourceExcelFile.xls


tnx,
ROdel
 
is this the same question from thread222-442272

Are you using a macro or "Real VB"?
Sometimes... the BASIC things in life are the best...
cheers.gif

or at least the most fun ;-)
-Josh Stribling
 
I answered your other thread... thread707-443420 Sometimes... the BASIC things in life are the best...
cheers.gif

or at least the most fun ;-)
-Josh Stribling
 
Hi Josh,

Tnx a lot! Sorry for the late response.

Rodel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top