Excel, VBA and save problems
Results 1 to 15 of 15

Thread: Excel, VBA and save problems

  1. #1
    Registered User
    Join Date
    Feb 2001
    Location
    Sunny Scotland
    Posts
    169

    Post Excel, VBA and save problems

    I have a little automated Excel program that pulls info from the company database, fills out forms and then saves the forms you want to a shared drive. At the same time, it updates the control log with the file details and a hyperlink to the file.

    I'm having a little problem with the saving though. I tested the program using my userID and can save to my machine (not much use in the end) and also to a shared folder I have full access to. The user that is using my program cannot, however, save to the shared folder he needs to save to. He has full permissions on the folder according to one of the on-site IT people. He can also manually put a file in the folder, but that's useless in this case as the hyperlink becomes invalid. Any ideas?

    Another colleague of mine had a similar issue with some of his programs which he managed to resolve by just having the folder open before he executed the save event in Excel, however I cannot use this solution with my program. Besides, it's a bit awkward.

    Any help would be most appreciated. Thanks!

  2. #2
    Driver Terrier NooNoo's Avatar
    Join Date
    Dec 2000
    Location
    UK
    Posts
    31,824
    Is your proggie running as system rather than the user?
    Never, ever approach a computer saying or even thinking "I will just do this quickly."

  3. #3
    Registered User
    Join Date
    Feb 2001
    Location
    Sunny Scotland
    Posts
    169
    Quote Originally Posted by NooNoo
    Is your proggie running as system rather than the user?
    Good question. I don't know! I suspect it's running as System however. How would I find out exactly (Win2kPro)? I couldn't find an option to find out in Task Manager or anything. How would I work around it if the program is running as System?

    The thing I've made is just an advanced Excel workbook, so the running process is Excel.

  4. #4
    Registered User CeeBee's Avatar
    Join Date
    Nov 2002
    Location
    USA
    Posts
    2,494
    Any error message?
    Protected by Glock. Don't mess with me!

  5. #5
    Registered User
    Join Date
    Feb 2001
    Location
    Sunny Scotland
    Posts
    169
    Not a sausage. As far as I can see, it pretends to save and then doesn't really.

    There was an error earlier today but it was due to an issue with the company database and not Excel. Unfortunately, company rules prevent me from posting the error message as it contains internal information.

  6. #6
    Driver Terrier NooNoo's Avatar
    Join Date
    Dec 2000
    Location
    UK
    Posts
    31,824
    Quote Originally Posted by ringo2143z
    Good question. I don't know! I suspect it's running as System however. How would I find out exactly (Win2kPro)? I couldn't find an option to find out in Task Manager or anything. How would I work around it if the program is running as System?

    The thing I've made is just an advanced Excel workbook, so the running process is Excel.
    The process should show up in task manager, along with it's owner. If you haven't got the owners listed view>>select columns should allow you to do it.
    Never, ever approach a computer saying or even thinking "I will just do this quickly."

  7. #7
    Registered User
    Join Date
    Feb 2001
    Location
    Sunny Scotland
    Posts
    169
    The only option in there which mentions "user" is USER Objects and the data it provides is no where near what I need. I would assume that the admins have disabled the option so you can't find out if they're checking your PC. I have registry access if there's a way to find it in there...

  8. #8
    Driver Terrier NooNoo's Avatar
    Join Date
    Dec 2000
    Location
    UK
    Posts
    31,824
    So your vba does not show up as a process?
    Never, ever approach a computer saying or even thinking "I will just do this quickly."

  9. #9
    Registered User
    Join Date
    Feb 2001
    Location
    Sunny Scotland
    Posts
    169
    Quote Originally Posted by NooNoo
    So your vba does not show up as a process?
    Nope. Since VBA is what you use to write macros, I wouldn't expect it to. All I would expect to see is 2 instances of Excel (one for the main window and one for the VBA editor), which I do. I just can't see who/what it's running under.

    Spoke to main IT boy about the problem, and he reckons it's something to do with a lost mapping to the drive or a lack of space. However, the drive is mapped and the drive still has 80gb free. The user permissions aren't an issue as they have full control. Apparently there are other programs onsite that work fine, but I don't know who, what or how.

  10. #10
    Driver Terrier NooNoo's Avatar
    Join Date
    Dec 2000
    Location
    UK
    Posts
    31,824
    oooh, it's part of excel...hmmmm

    I assume his security allows him to run macros? Set to medium or low?

    And as dumb as this sounds... have you tried editing the vba while logged in as him? Could it be that because he didn't write it, the security features are having a fit?

    what is the command line you are using to save? Is it a mapped drive or a unc?
    Last edited by NooNoo; August 28th, 2005 at 05:16 AM.
    Never, ever approach a computer saying or even thinking "I will just do this quickly."

  11. #11
    Registered User
    Join Date
    Feb 2001
    Location
    Sunny Scotland
    Posts
    169
    Yeah, the security allows macros. Haven't tried editing logged on as him, although it is an idea and I will try it on Tuesday with a re-compile.

    To save, I just call the SaveAs dialog to the screen. I decided it was easier that way then force save somewhere that might change in the future. The drive is mapped as far as I'm aware (the logon script says mapping S: to //xxxxxxxxx/xxxxxxxx/xxx).

  12. #12
    Driver Terrier NooNoo's Avatar
    Join Date
    Dec 2000
    Location
    UK
    Posts
    31,824
    So the actual save is not done programmatically? Or do you mean ActiveWorkbook.SaveAs Filename:="S:\User\JoeDoe\" & MyFile
    Never, ever approach a computer saying or even thinking "I will just do this quickly."

  13. #13
    Registered User
    Join Date
    Feb 2001
    Location
    Sunny Scotland
    Posts
    169
    The line I use in the code is: Application.Dialogs(xlDialogSaveAs).Show. So yes, the actual save is not done programmatically. I've previously tried the SaveAs line but I decided it was unappropriate in this case.

  14. #14
    Registered User JeffO93's Avatar
    Join Date
    Sep 2002
    Location
    Denver
    Posts
    134
    Are you sure the user has the same VBA components installed on his computer?
    Office doesn't, by default, install all VBA. I go in and tell it to install ALL of Office, and then I de-select the Language bar, Hand Writing toy, and a couple other stupid M$ annoyances.
    The VBA is grayed-out, by default. So that means only some of most-often used components are used. If your macro needs a newer version of Office VBA, or Office Service Pack, or additional components, then it could create similar problems.

    To determine whether the problem is with the security, or with the user's computer, you could set the user up on your computer as a local admin and see if it works while he's logged on. If it does work, then the problem is with something on his computer (setting or component).

  15. #15
    Registered User
    Join Date
    Feb 2001
    Location
    Sunny Scotland
    Posts
    169
    Thanks for the reply.

    The VBA code only runs across 2 workbooks and has no references to other Office apps, so there should be everything required installed. As for the Office installation, the IT people image a standard issue drive which has all of Office installed. He definately has the necessary VB editor and whatnot as I've edited code on his PC before now.

    Unfortunately I do not have rights to set up any users at work. I'm an intern, and I do have full admin rights for some reason, but I'd get chopped up into small bits if I'm bad. I finish tomorrow, so after that it's not my problem. I'll check the code again today and do some further testing however.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •