How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask Richard Your Own Question

Richard, Software Specialist
Category: Microsoft Office
Satisfied Customers: 30207
Experience:  Over 15 year experience resolving Microsoft Office Issues
Type Your Microsoft Office Question Here...
Richard is online now
A new question is answered every 9 seconds

First, thank you thus far for your help. The next question

This answer was rated:

First, thank you thus far for your help. The next question is how to combine the following 2 commands to provide the result I am looking for. I uploaded file 699430, which has a button 141 on the right side, labeled "Insert Picture" the command currently opens a specific file folder on our server.

I, also, uploaded file 416516 which I had found a code to insert a specific file, in a specific location within the spreadsheet, with a specific size. This file has a button 929 on the right side, labeled "Insert Picture". The issue with this command is, that it opens the last file folder the user had previously opened, not a specific folder.

The question is can we combine the (2) commands, so on click, it opens the specific file folder on the server, and then when I open a file within the folder, it places the file in specific location within the sheet, and sized to my parameters that I would set within the code?
ok, looking at this
ok, so if I understand

you want the code from the picture file excel to run after the code from the macro I made for you?

Customer: replied 3 years ago.

Yes, the macro you made, opens the specific folder, and then we want to run the picture file code

ok, I think I understand

Like this Curtis?

It runs first my code, then the picture code.


Customer: replied 3 years ago.

No this is not working. When this code runs, it first opens the file folder "Canvas_Sign Band" Which is where the code is pointing to, as it should. But then the next step of the code tells it to open an additional file folder, which contains images, then allowing me to select the image I want inserted in the worksheet.


What I am hoping to accompolish is when the code runs, it only opens the one (specified) folder that I have images stored in, then allowing me to select the image I want inserted in the worksheet.


Again, to make sure I am clear on my discription, as the code is currently written, when the second part of the code runs it opens a file folder, that is not specified. It only opens the last folder I had opened outside of Excel, so it does not contain the image files I am wanting to insert.

Customer: replied 3 years ago.

I put together some screen shots, maybe this will help me more clearly explain what I am looking for, I uploaded the file #960736

Go it

In the code, add just before, szPicFileName = Application.GetOpenFilename()

ChDir "c:\test"

So it looks like this

ChDir "c:\test"
szPicFileName = Application.GetOpenFilename()

Set c:\test to be any folder you wish for it to default open to

Let me know if you have any difficulties please

Thank you

Customer: replied 3 years ago.

Still not there, but getting close. I have uploaded a couple more screen shots 611474. I also uploaded the excel file again 245344, after changing the code for button 141, instead of button 158.


Button 158 was already working properly, so I wanted to make sure I was not creating more of an issue using that button. The one that is in question is button 141

ok, it appears you had the button to the wrong Macro

I have corrected this and in my test, clicking the Button gets me to the Folder I specified in the code.

Test and Let me know the results please


Thank you
Customer: replied 3 years ago.

I keep getting the same result. I am not sure what to do next?


At this point the only unresolved issue is that it is not opening the specific folder, which is:


\\VICTORYSRV1\Share\Pictures 2013\canvas


I tried replacing the file with folders on my local computer, such as, the C: and also a thumb drive E: and they worked properly.


So it appears that issue is in the syntax for reaching a drive on a server?

ok, I dont have a network drive here to test

But if you map the drive to SHARE, so it appears as x:\

then use x:\Pictures 2013\canvas

Does that work?

Customer: replied 3 years ago.

No, I mapped the share drive to x: with no success, and just for grins I then disconnected x: and mapped the share to t: again with no success.

The other command buttons are opening files on the server, without issue, can it be the ChDir command creating the problem?

ok, I see the issue

You still need to map a drive

But put directly above the chdir

chDrive "X"

This sets to X

Then you use chDIR directly underneath

let me know how you go
Customer: replied 3 years ago.

Yes, just did a Bing search for the issue, and came up with the same answer. It works great, Thanks

Your welcome Curtis

You would think they would have included it.

If you have continued problems, or would like any additional information or assistance, please do not hesitate to let me know.

And if you can take a second to rate my service, that would be greatly appreciated.

Thank you
Richard and 4 other Microsoft Office Specialists are ready to help you