Solved

having troubles with an Excel Macro saving to C: on Windows 10

Posted on 2016-10-06
9
38 Views
Last Modified: 2016-10-06
I have this certain file from the Bank to do payroll stuff. (Very hokey but I won't get in to that).

At the end of the process, I invoke a Macro that saves certain data to a folder on the C: Drive.

The macro always gives the following error:
screenshot 1
I'm suspecting that there is some kind of security issue going on that I cannot save to the C: drive. If so, please how can I circumvent that.

-  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  

As an FYI, here is a screenshot of the area of the macro that causes the problem. The particular folder in question, namely "C:/Produbanco/" is indeed set up.

screenshot2
-  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  

I've had several very frustrating talks on the phone with the support people at the bank to no avail.

Please help. Thanks! :D
0
Comment
Question by:gregholl
9 Comments
 
LVL 20

Expert Comment

by:CompProbSolv
ID: 41832828
Make sure that dirCambio is a proper string for a full file spec.  I'd display it in a message box surrounded by <> to confirm that it is what you expect and doesn't have any spaces or other issues.
0
 
LVL 1

Author Comment

by:gregholl
ID: 41832883
Hi. There is no problem with the Macro itself. This was not made by me. I would rather not mess with it. This exact same Excel document works just fine on my old computer which was running Windows Server Edition 2012. I transfer the Excel file to the new computer under Windows 10, and the macro gets this error.

How do I make it so that, by default, the macro can save things to the C:  drive?
0
 
LVL 51

Expert Comment

by:Joe Winograd, EE MVE
ID: 41832899
Hi Greg,
What is in the variable nomArch and what is its type? Note that + is being used as the concatenation operator rather than &. Regards, Joe
0
 
LVL 1

Author Comment

by:gregholl
ID: 41832920
Joe Winograd: Please let's not deal with the syntax of the macro. It's fine, because it works on other computers. I honestly think, as mentioned before, that I need to activate the C: drive somehow to allow writing to it without any security warning.

Thanks Joe, but I really don't think we need to get into macro syntax and I don't really understand it anyway.
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 51

Expert Comment

by:Joe Winograd, EE MVE
ID: 41832936
Greg,
You said in the original question, "The particular folder in question, namely "C:/Produbanco/" is indeed set up." The point is, that is not the folder in question. The folder in question is the concatenation of C:\Produbanco\ (I fixed your forward slashes to backslashes) with whatever is in the variable nomArch. So the subfolder that it is trying to write to may, indeed, not exist on your new computer, but does exist on your old computer. Hence, it throws the "Path/File access error" on the new computer but not the old one. Go to your old computer and look at the subfolders of C:\Produbanco\ — make sure they exist on the new computer, and if not, create them. Regards, Joe
0
 
LVL 1

Author Comment

by:gregholl
ID: 41832997
Sorry about the slashes.

Here's some screen shots from the old computer.

a) I deleted the folder called C:\Produbanco\ just for this exercise. I try to run the Macro. I get this error:
1(It says: "Produbanco folder doesn't exist; please create it).

b) So I make the folder, as requested. No sub folder or anything.
2
c) Now I run the macro again, and it works just fine.
3(It says: "The Provider payment file was successfully created at C:\Produbanco\pagos fin sep.txt)

-  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  

regarding nomArch and the concatenation:
The macro works like this. I put in a certain cell the name I want the file to have. It this case, I entered the text:  "pagos fin sep". Then the concatenate puts it all together and I get: C:\Produbanco\pagos fin sep.txt

I don't honestly know what nomArch means but I figure that it's taking the name I put in from that particular cell.

-  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  

Now.... replay with this exact same Excel document, on the same version of Excel, but on the new computer and I get the error as shown in the original question.

Hope that sheds some light to be able to troubleshoot this issue.
0
 
LVL 43

Accepted Solution

by:
Saqib Husain, Syed earned 500 total points
ID: 41833004
For testing

if you have a D drive then try changing C: to D: on the highlighted line.
0
 
LVL 1

Author Closing Comment

by:gregholl
ID: 41833009
Yup. That did it. All fine now. sooooo. happy!  ;)

Thanks
0
 
LVL 51

Expert Comment

by:Joe Winograd, EE MVE
ID: 41833096
Sorry...away from the computer for a while.

> I don't honestly know what nomArch means

Well, if the concatenation is resulting in C:\Produbanco\pagos fin sep.txt, then nomArch is obviously the file name, not a subfolder.

I thought you wanted to get it working on the C: drive ("I would rather not mess with it [the macro]"), but if you're OK with changing the macro to work on D: (or E: or H: or whatever), that's great. Still doesn't answer the question of why it's not working on C: — but if you're happy, that's all that matters. And I was happy to try to help you. Regards, Joe
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Windows 10 introduced a new kind of product activation called Digital Entitlement, in addition to using the conventional product key activation. In this article I investigated the detail of such activation and provide some tips so you can understand…
Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now