Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi, I have a file (invent) in wich a Autoopen() macro was writed, the
autoopen macro opens a file named: c:/mis documentos/registros.xls, this file is always saved in the same folder as the invent file, ¡How to tell excells that the file registros.xls is in the same folder than invent.xls so when I install both files in another computer I don need to change the autoopen macro??? TVMIA |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
ThisWorkbook.FullName will give the file name including the path. The
following will strip away the file name, giving only the path: FilePath = Left(ThisWorkbook.FullName,InStrRev(ThisWorkbook.F ullName,"\")) You can then use this in your code to open the workbook: Workbooks.Open FilePath & "registros.xls" "filo666" wrote: Hi, I have a file (invent) in wich a Autoopen() macro was writed, the autoopen macro opens a file named: c:/mis documentos/registros.xls, this file is always saved in the same folder as the invent file, ¡How to tell excells that the file registros.xls is in the same folder than invent.xls so when I install both files in another computer I don need to change the autoopen macro??? TVMIA |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
thanks for your help in this an the other questions.
"K Dales" wrote: ThisWorkbook.FullName will give the file name including the path. The following will strip away the file name, giving only the path: FilePath = Left(ThisWorkbook.FullName,InStrRev(ThisWorkbook.F ullName,"\")) You can then use this in your code to open the workbook: Workbooks.Open FilePath & "registros.xls" "filo666" wrote: Hi, I have a file (invent) in wich a Autoopen() macro was writed, the autoopen macro opens a file named: c:/mis documentos/registros.xls, this file is always saved in the same folder as the invent file, ¡How to tell excells that the file registros.xls is in the same folder than invent.xls so when I install both files in another computer I don need to change the autoopen macro??? TVMIA |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It works just as expected, ¿where you learn to VB programation??
some book that I could buy??? "filo666" wrote: thanks for your help in this an the other questions. "K Dales" wrote: ThisWorkbook.FullName will give the file name including the path. The following will strip away the file name, giving only the path: FilePath = Left(ThisWorkbook.FullName,InStrRev(ThisWorkbook.F ullName,"\")) You can then use this in your code to open the workbook: Workbooks.Open FilePath & "registros.xls" "filo666" wrote: Hi, I have a file (invent) in wich a Autoopen() macro was writed, the autoopen macro opens a file named: c:/mis documentos/registros.xls, this file is always saved in the same folder as the invent file, ¡How to tell excells that the file registros.xls is in the same folder than invent.xls so when I install both files in another computer I don need to change the autoopen macro??? TVMIA |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Just some added information.
ThisWorkbook.Path gives just the path. workbooks.Open thisworkbook.Path & "\registros.xls" -- Regards, Tom Ogilvy "K Dales" wrote in message ... ThisWorkbook.FullName will give the file name including the path. The following will strip away the file name, giving only the path: FilePath = Left(ThisWorkbook.FullName,InStrRev(ThisWorkbook.F ullName,"\")) You can then use this in your code to open the workbook: Workbooks.Open FilePath & "registros.xls" "filo666" wrote: Hi, I have a file (invent) in wich a Autoopen() macro was writed, the autoopen macro opens a file named: c:/mis documentos/registros.xls, this file is always saved in the same folder as the invent file, ¡How to tell excells that the file registros.xls is in the same folder than invent.xls so when I install both files in another computer I don need to change the autoopen macro??? TVMIA |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
There are many books available; I learned mostly by online documentation (but
I have several years experience programming in other languages) My main sources of info we Application help files - look for "Programming Information" in the contents Web: there are many sites for VBA programming (Google search, or look through these newsgroups for referenced sites) Finally, MSDN knowledge base and library were helpful. "filo666" wrote: It works just as expected, ¿where you learn to VB programation?? some book that I could buy??? "filo666" wrote: thanks for your help in this an the other questions. "K Dales" wrote: ThisWorkbook.FullName will give the file name including the path. The following will strip away the file name, giving only the path: FilePath = Left(ThisWorkbook.FullName,InStrRev(ThisWorkbook.F ullName,"\")) You can then use this in your code to open the workbook: Workbooks.Open FilePath & "registros.xls" "filo666" wrote: Hi, I have a file (invent) in wich a Autoopen() macro was writed, the autoopen macro opens a file named: c:/mis documentos/registros.xls, this file is always saved in the same folder as the invent file, ¡How to tell excells that the file registros.xls is in the same folder than invent.xls so when I install both files in another computer I don need to change the autoopen macro??? TVMIA |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Searching, matching then searching another list based on the match | Excel Discussion (Misc queries) | |||
12th root of two | Excel Programming | |||
Root of Sum | Excel Programming | |||
Nth Root | Excel Programming | |||
windoes system directoty? | Excel Programming |