|
-
Apr 12th, 2005, 01:48 PM
#1
Thread Starter
Frenzied Member
is there an app.path....
type function for use within a Access Database? I have alot of pathing going on inside my DB and would like to make it easier. Is there anything similar to the app.path in VB?
-
Apr 12th, 2005, 01:58 PM
#2
Re: is there an app.path....
There are a few depending on what you need the path of.
Application.CurrentDB.Name = "C:\RobDog888.mdb"
Application.SysCmd acSysCmdAccessDir = Access Installation Path
'...
'...
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 8th, 2006, 12:23 PM
#3
Addicted Member
Re: is there an app.path....
Hi RobDog888,
How about if I just wanted to use app.path for this statement?
Workbooks.Open FileName:= App.Path & "MyExcel.xls"
Thanks
 Originally Posted by RobDog888
There are a few depending on what you need the path of.
Application.CurrentDB.Name = "C:\RobDog888.mdb"
Application.SysCmd acSysCmdAccessDir = Access Installation Path
'...
'...
-
Jan 8th, 2006, 12:27 PM
#4
Re: is there an app.path....
App.Path is a VB6 function. If your automating Excel from VB6 then its ok.
Excel also has Application.Path but its the path of Excel and not the workbook
There is the WorkBook.Path too.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 8th, 2006, 05:39 PM
#5
Addicted Member
Re: is there an app.path....
Is this the correct syntax? I tried, but it says "object required"
Workbooks.Open FileName:=Workbook.Path & "MyExcel.xls"
Please help or point me to some reading materials.
Thanks,
Iat
 Originally Posted by RobDog888
App.Path is a VB6 function. If your automating Excel from VB6 then its ok.
Excel also has Application.Path but its the path of Excel and not the workbook
There is the WorkBook.Path too.
-
Jan 8th, 2006, 05:48 PM
#6
Re: is there an app.path....
Sorry, it should be ActiveWorkbook.Path instead of Workbook.path but if your trying to open a workbook the there is no workbook or path.
Where are you trying to open it from? Path of Excel program, path of current open workbook, or ?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 8th, 2006, 05:57 PM
#7
Addicted Member
Re: is there an app.path....
I have a macro (macro.xls) that lives in c:\temp folder. This macro.xls will open another .xls (MyExcel.xls) file that also in that same folder.
Some how this syntax (below) worked just fine at my work pc but the same syntax with the same folder structure didn't work at home because it can't find the MyExcel.xls file.
Workbooks.Open FileName:="MyExcel.xls"
In VB6 I would just add App.path & "\" & "MyExcel.xls" but need the same effect in VB Office.
TIA
Iat
-
Jan 8th, 2006, 09:54 PM
#8
Re: is there an app.path....
Then since one workbook is opening another yo will need to use -
ActiveWorkbook.Path
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 9th, 2006, 07:15 AM
#9
Addicted Member
Re: is there an app.path....
Thanks RobDog88. ActiveWorkbook.path did it!!!! Do you know are there any reading references on the net where I can look up VBA for Excel?
Thanks again,
Iat
-
Jan 9th, 2006, 07:18 AM
#10
Re: is there an app.path....
Here at vb forums or just a google search but I think we have allot here.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 10th, 2006, 05:36 AM
#11
Re: is there an app.path....
 Originally Posted by RobDog888
There are a few depending on what you need the path of.
Application.CurrentDB.Name = "C:\RobDog888.mdb"
Application.SysCmd acSysCmdAccessDir = Access Installation Path
'...
'...
Besoup :
If you are in ADO try : CurrentProject.path
in addition to RogDogs post
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|