Copy file from ehternet-connected FTP - no internet - excel

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

Related

PathFile Access Error when saving in G drive directory

So the issue is as follows.
I have created a VBA task that runs a query that returns some insignificant amount of data in our databases. It then does some simple calculations in the excel file, and finally it creates a new folder and it the saves the file to our department shared drive in Google Drive (we have a windows explorer path to the directory named G drive).
It works ok on my end but now I have sent the whole .xlsm file to my collegue and once she run the vba code, it throws an error saying Path/File Access Error. We have tried chaning the directory where it creates a folder and saves the file on her local C drive, and it works just fine.
Any ideas how to remedy this issue?
Instead of uploading to a windows explorer path, you should upload to an absolute path of google drive, as that is the same no matter who tries to access it. There is a guide here that accomplishes exactly that:
https://medium.com/coalmont/google-drive-api-using-excel-vba-80e3d7e41488
If for some reason that guide is not available, just google something like "vba excel upload google drive".

Sharepoint-Mapped Network Drive can create new folders but not rename

I was able to map my sharepoint drive on my local computer (Note: this was not using the sync option on sharepoint, as I do not have access to do so). I am able to create new folders, however I am unable to rename it. When I try to rename the folder, I get the following message, regardless of how many characters I put:
I can change the file name from the sharepoint web portal, but not on my mapped network drive.
I am using Windows 10
I don't know if it's the same problem, but this guy got the same error message when he mapped the drive using a / at the end of the URL.
(i.e. he solved remapping: https://hostname.domain.com/Shared Documents
instead of: https://hostname.domain.com/Shared Documents/ )

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.

Renaming executable's image name is giving it write permission

Dear community members,
We have three of same hardware Windows 7 Professional computers. No one of them is connected to a domain or directory service etc.
We run same executable image on all three computers. In one of them, I had to rename it. Because, with my application's original filename, it has no write access to it's working directory.
I setup full access permisions to USER group in working directory manually but this did not solve.
I suspect some kind of deny mechanism in Windows based on executable's name.
I searched the registry for executable's name but I did not find something relevant or meaningfull.
This situation occured after lot of crashes and updates of my program on that computer (I am a developer). One day, it suddenly started not to open files. I did not touch registry or did not change something other on OS.
My executable's name is karbon_tart.exe
When it start, it calls CreateFile (open mode if exist or create mode if not exist) to open karbon_tart.log file and karbon_tart.ini file.
With the files are exist and without the file exists, I tried two times and none of them, the program can open the files.
But if I just rename the name to karbon_tart_a.exe, program can open files no matter if they are exist or not.
Thank you for your interest
Regards
Ömür Ölmez.
I figured out at the end.
It is because of an old copy of my application in Virtual Store.

Using SAS X Command with PCFILES server

I have some SAS code that writes out to a specific sheet in an excel workbook. The other sheets have formulas that look to this sheet so the workbook is basically a template that gets populated when my code is run.
I want to be able to run the code multiple times, and end up with a different version of the template each time it is run. I'm thinking the easiest way to achieve this is write out to the template and then use x command or something to copy the workbook and then rename it.
SAS is on a linux server and I use a pc files server to write to excel. How do I set up x command to copy the file and change its name on the remote server?
Sorry for the late answer, but I just encountered this myself and can provide a solution.
Can you access files on the sas server through windows (with an SMB share or similar)? That is the easiest way to do this. If you can't, it is typically very easy to set up Samba on linux.
First, store the excel template on the SAS server where it can be seen from your windows computer (with the PC Files Server on it).
Lets say the file is in '/home/files/template.xlsx' on the SAS server, and that directory is shared and accessible on your windows server as '\linuxservername\files\template.xlsx' (or \192.168.1.5\files\template.xlsx if you are using IP addresses)
Now you just have to use the SMB path for the PCFILES stuff and the local linux path for the x command. Something like
x 'cp /home/files/template.xlsx /home/files/output.xlsx';
libname output PCFILES
path='\\linuxservername\files\template.xlsx'
server='PCFilesServerName'
port=1234;
Note that when feeding a path to PCFiles, you use the network address (since your windows box has to be able to read and write it) and when you issue the copy command, you use the local address.
You may also be able to use the network path for everything depending on your system configuration. When I tried it, I could not make it work since the unix server did not like it (it shares the folder over SMB, but it didn't know how to access it from the command line).

Resources