Use of CurrentProject.Path in export code
Set oWB = oXL.Workbooks.Open("C:\Users\GG\Documents\TestingM isc\FileName.xls")
I can't seem to find a way substitute CurrentProject.Path & "\" & FileName.xls for the actual path-I assume that I am not using quotes properly, but have given up on trying combinations. Can someone tell me how to do it?
I am using A2007 in W7 64 bit computer
Thank you for taking the time to report an issue.
What's wrong... Please write below.
Here's the code:
Function Macro2() On Error GoTo Macro2_Err
DoCmd.TransferSpreadsheet acExport, 10, "Ass+Traf", CurrentProject.Path & "\queries.xlsm", True, "Sheet2"
DoCmd.TransferSpreadsheet acExport, 10, "ParqueSet2010 p/ Gessica", CurrentProject.Path & "\queries.xlsm", True, "Sheet3"
Exit Function Macro2_Err:
When I replace xlsm for xlsx it works fine, but in the above case I get the following error:
"Cannot update. Database is read-only".
I checked the file properties, and the read-only box is unchecked.
Does anyone know why this happens?
I need to export to a xlsm because I want to build excel macros in the destination file ("queries
This would probably work fine, but what I have realized is that currentproject.path is going to be a hidden folder, and I don't want the end user mucking around in this folder. Any other suggesstions
In order to make sure the app would work no matter what directory they used to put the app and input files on thier computer, I employed the currentproject.path command:
CurrentProject.Path & "\input.xls"
It worked like a dream on my computer, and can move the app around from folder to folder without it falling over.
However, my colleague isn't so fortunate. When they run it, it goes off to look for the input files in their c:\temp directory. We've tried it with 2 other computers and get the same result. It works fine on mine (in any directory) but not on another PC
When a database is split, the back-end is placed in a centralized location and the front-end on the individual work stations. Say for example the current event of a form is running a code that is supposed to look at the current database's path using currentproject.path. I know that the code will be executed from the workstation where the front-end is open, but is it going to look at the path name of where the back-end is located? Because it is supposed to look in a folder that is in the same directory as the back-end
in Combobox I would like to see just the title (column1) but the imagine to take data from column 2 - where is stored the path to imagine:
this is the code from VBA:
Private Sub Combo3_Change()
'Me.Image0.Picture = CurrentProject.Path & "\" & Me.Combo3.Column(2)
Me.Image0.Picture = Me.Combo3.Column(2) End Sub Private Sub Form_Load()
'Me.Combo3.RowSource = "SELECT imagini.imagineID, imagini.titlu, imagini.cale_imagine FROM imagini ORDER BY [titlu]"
Me.Combo3.RowSource = "SELECT imagini.imagineID, imagini.titlu," & Application.CurrentProject.Path & "\" & "[cale_imagine] AS Expr1 FROM imagini ORDER BY [titlu]" End Sub
the error is on this line
Me.Combo3.RowSource = "SELECT imagini.imagineID, imagini.titlu," & Application.CurrentProject.Path & "\" & "[cale_imagine] AS Expr1 FROM imagini ORDER BY [titlu]"
syntax error missing operator
So far I found Application.CurrentProject.ImportExportSpecificati ons.Item but that is read-only and asking for the name of my stored import
Also, before the form comes up I would like it to hide the ribbon and files on the left.
Lastly, I need it to check the current project to see if it is trusted. Unfortunately, All I found was currentproject.istrusted; which to me looks like vba code which isn't trusted. I triedputting it under condition but it puts brackets around it like it is fields.
Okay nevermind on the currentproject part I got that. just need the ribbon and files hiding and splash screen