How to open MS Access in Runtime using Excel VBA? - excel

I'm struggling on how to open MS Access Runtime using VBA, from an Excel file.
You can open the full version of Access using CreateObject("Access.Application"), but that doesn't open Access in Runtime.
We only have Microsoft Access Runtime installed in some computers, because that's all we need to use the front-ends we've developed. So we need to open the accdb files using MS Access Runtime, but from Excel.
Any help is appreciated, thank you

You can use the Shell to open a file, as if you typed that command into window's command prompt.
d = Shell("pathToFile\Database1.accdb /runtime", vbNormalFocus)
Another option you could use to open in the file in runtime (if someone opens it from the folder or through some other method without the /runtime switch) would be to change the file extension to .accdr. This will always force runtime.

Related

How to make ssis excel data source task to not fail even when the file is open and being used by another user?

I have an SSIS package that will read excel files from a shared network drive. I am using excel data source task.
In visual studio the task works fine even if the excel file is open and being used by another user.
When I deploy the package to the ssis catalog, and execute, the package fails when the file is open with someone.
Is there any way to make the excel task work even when the file is open?
By default the Excel provider controls this since it doesn't open a file in shared mode.
You can otherwise use a File System Task to copy the Excel file from a shared location to a private one and use it in your Data Flow.

Using xlwings to open an Excel file on Mac OS X El Capitan requires Grant Access pop-up

If I manually grant access to a file, my code is able to open the document in subsequent runs. I will be working with new files each day so I would like to eliminate the grant access pop up window. I've tried sudo python myscript.py, but it doesn't resolve the issue.
While the open() function is able to open the file, I want to be able to use the range style referencing available in xlwings.
Will you please tell me how to grant Python (or just my script), not only to the individual files that are currently in the folder but also any files which get added to a folder in the future?
The issue you're seeing has nothing to do with Python or xlwings, but is really a "feature" of Excel 2016 on Mac: It is sandboxed and thus cannot access files outside of the app's directory, see this answer and this tutorial.
To revive this thread for Office 365 and Catalina: it is still necessary to save Excel files here:
~/Library/Containers/com.microsoft.Excel/Data
to avoid the prompt for granting access.
or to this folder generally for Office files:
~/Library/Group\ Containers/UBF8T346G9.Office

MS-Access 2013 unable to remove .laccdb locking file

This is a long shot, but does any one know how to remove the lock file created by access 2013 file type ".laccdb".
I have an excel sheet which is connected to the access database via power query. The access database is on a shared drive. However even when this file is closed the locking file for the access database is not deleted.
When trying to remove the lock file it just says that unable to close as another program is using.
I've closed down the machine, removed all temp files, checked nothing is running and also checked in computer management within the administration tools. and checked for any open files.
I know the database should be split to stop this happening. however this is not my database, and the user refuses to split.
Any help will be grateful.
You can open and read the lock file with a text editor (I use Notepad++); within the file you should find the computer name (or some similar identifier) of the one(s) who have it open. You could then take that name/number/whatever to IT and see if they can identify who the user is. You should be able to close it from their computer. Hope this helps.

Copy file from ehternet-connected FTP - no internet

I have a device that stores data in an FTP-accessible folder. I can connect to it through windows (ftp:10.19.1.101) and map drive to it (C:\Users#ME#\AppData\Roaming\Microsoft\Windows\Network Shortcuts\MyDevice). There are no usernames or passwords - if the device is attached, you have access.
i can click and drag the file in Windows. I want to automate that in VBA so I can process the file.
The single file is located at the root (ftp://10.19.1.101/fs.log), and I want to copy it to a location on my C drive to process it in Excel. I've tried for hours using code snips found here to no avail. I don't access the internet to get it, and I think that might be the problem, since 99% of FTP activity is that way.
FileCopy doesn't work either.
Any help appreciated
If you can access it and map it to a drive, open up a cmd then type 'net use' and hit enter (when it's plugged in and mapped to a drive). You should then have the long location used by windows which you can use in your procedures to play around with the file?
HTH

Error while running VSTO application from Network path CannotCreateCustomizationDomainException

Environment: VS2008 .NET 3.5 - VSTO runtime 3.0 - Excel 2007
We have published the VSTO Excel document level customization to network path. All our users are able to copy the .xltm file from the network location to desktop(all the assemblies are still in networkpath) and able the run the customizations when the file is opened. When file is opened, it asks for install and user installs and proceed. It works fine. But, all these users are administrators to their machine. But, there is one special case. One of the user is using server machine to use these customizations and he is not an administrator on that machine. When he tries to open the .xltm file, he is getting error
Microsoft.VisualStudio.Tools.Applications.Runtime.CannotCreateCustomizationDomainException:
This document contains custom code that cannot be loaded because the
location is not in your trusted locations list: XXXX.XLTM. If you
trust this document you can save and open it from a location on your
computer. For more information, see
http://go.microsoft.com/fwlink/?LinkId=99104. at
Microsoft.VisualStudio.Tools.Office.Runtime.RuntimeUtilities.VerifyDocumentIsTrusted(String
documentFullLocation, String documentName, OfficeVersion
officeVersion) at
Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.CreateCustomizationDomainInternal(String
solutionLocation, String manifestName, String documentName, Boolean
showUIDuri
We added the \networkpath and subfolders to Excel trusted locations, enabled all macros. But, still he is getting the error. I also added the file://networkpath to trusted sites in IE. Still no luck. Still he is getting the error.

Resources