Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Dear All,
I want to open an additional workbook using VBA. 'Where I get file name; This works txtTradeTrackerFile = ThisWorkbook.Worksheets("Access").Cells(3, 5) 'I don't know how to solve this cause of error in my project 'It works in Access. However, in Excel I really don't know :-) Set xBook = Workbooks.Open(CurrentProject.Path + "\" + txtTradeTrackerFile) Please give me suggestion. Thanks, March |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Set xBook = Workbooks.Open(ThisWorkbook.Path & Application.PathSeparator &
txtTradeTrackerFile) -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "March" wrote in message ... Dear All, I want to open an additional workbook using VBA. 'Where I get file name; This works txtTradeTrackerFile = ThisWorkbook.Worksheets("Access").Cells(3, 5) 'I don't know how to solve this cause of error in my project 'It works in Access. However, in Excel I really don't know :-) Set xBook = Workbooks.Open(CurrentProject.Path + "\" + txtTradeTrackerFile) Please give me suggestion. Thanks, March |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You are close...
txtTradeTrackerFile = ThisWorkbook.Worksheets("Access").Cells(3, 5) on error resume next Set xBook = Workbooks.Open(thisworkbook.Path & "\" & txtTradeTrackerFile) on error goto 0 if xbook is nothing then msgbox "the book was not successfully opened" end if -- HTH... Jim Thomlinson "March" wrote: Dear All, I want to open an additional workbook using VBA. 'Where I get file name; This works txtTradeTrackerFile = ThisWorkbook.Worksheets("Access").Cells(3, 5) 'I don't know how to solve this cause of error in my project 'It works in Access. However, in Excel I really don't know :-) Set xBook = Workbooks.Open(CurrentProject.Path + "\" + txtTradeTrackerFile) Please give me suggestion. Thanks, March |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thank you so much.
"Jim Thomlinson" wrote: You are close... txtTradeTrackerFile = ThisWorkbook.Worksheets("Access").Cells(3, 5) on error resume next Set xBook = Workbooks.Open(thisworkbook.Path & "\" & txtTradeTrackerFile) on error goto 0 if xbook is nothing then msgbox "the book was not successfully opened" end if -- HTH... Jim Thomlinson "March" wrote: Dear All, I want to open an additional workbook using VBA. 'Where I get file name; This works txtTradeTrackerFile = ThisWorkbook.Worksheets("Access").Cells(3, 5) 'I don't know how to solve this cause of error in my project 'It works in Access. However, in Excel I really don't know :-) Set xBook = Workbooks.Open(CurrentProject.Path + "\" + txtTradeTrackerFile) Please give me suggestion. Thanks, March |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
excel 2003 saved file will not open without a blank workbook open | Excel Discussion (Misc queries) | |||
Need VB code for workbook open to open a link | Excel Discussion (Misc queries) | |||
Search open sheets in workbook and insert into open sheet | Excel Discussion (Misc queries) | |||
Excel workbook does not open in open window on desktop | Excel Discussion (Misc queries) | |||
Importing Data from unopened Workbook into an open Workbook | Excel Discussion (Misc queries) |