Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to create a string literal in Excel 2k VB language. Example below:
Part 1 in a procedure called Worksheet_Change Dim BkNme As String BkNme = "Book2.xls" Part 2 in a procedure called Wrkbk_Open(BkNme) Dim WrkBk As Workbook Dim BKPath As String BKPath = "C:\Documents and Settings\My Documents\Excel\" WrkBk = Join(BKPath, BkNme, """) WrkBk should end up with: "C:\Documents and Settings\My Documents\Excel\Book2.xls" so that the following function can use Workbooks.Open Filename:= _ WrkBk, UpdateLinks:=3 WrkBk should endup containing the following: "C:\Documents and Settings\My Documents\Excel\Book2.xls" |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Rick,
Whilst you could use Join: BkNme = "Book2.xls" BKPath = "C:\Documents and Settings\My Documents\Excel" WrkBk = Join(BKPath, BkNme, "\") it would be more normal to concatenate: BkNme = "Book2.xls" BKPath = "C:\Documents and Settings\My Documents\Excel\" WrkBk = BKPath & BkNme Also, I'm somewhat doubt about the procedures you have <created. If these are supposed to be Excel event routines, it is better to get VBA to generate the signatures for you, to ensure they are correct. - Open the required module; e.g. double click Sheet1 in the VBE. - Select Worksheet from the top left combo in the code pane. - Select the required event (e.g. Change) from the top right combo in the code pane. NickHK "Rick" wrote in message ... I need to create a string literal in Excel 2k VB language. Example below: Part 1 in a procedure called Worksheet_Change Dim BkNme As String BkNme = "Book2.xls" Part 2 in a procedure called Wrkbk_Open(BkNme) Dim WrkBk As Workbook Dim BKPath As String BKPath = "C:\Documents and Settings\My Documents\Excel\" WrkBk = Join(BKPath, BkNme, """) WrkBk should end up with: "C:\Documents and Settings\My Documents\Excel\Book2.xls" so that the following function can use Workbooks.Open Filename:= _ WrkBk, UpdateLinks:=3 WrkBk should endup containing the following: "C:\Documents and Settings\My Documents\Excel\Book2.xls" |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Workbook_Open event not firing for Excel2K | Excel Programming | |||
Arrays and Join Function | Excel Programming | |||
Function: Join Cells with Format | Excel Programming | |||
extracting data from word2k to excel2k | Excel Programming |