+ Reply to Thread
Results 1 to 4 of 4

Run-time error when saving with macro

  1. #1
    Forum Contributor
    Join Date
    07-26-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2016 Office 365 ProPlus
    Posts
    826

    Run-time error when saving with macro

    Hi All,
    I made a model for our department and part of this model is the option to generate, from excel, a word document with data from excel and then save it to a shared drive.
    Now the strange thing that happend suddenly that 1 user gets a Run-time error '13' : Type mismatch.
    Up till now no other users (including me) are getting this error. For me it just works fine.
    Can anybody tell me what is going on here? In the past she was also able to generate the word file.
    And just to let you know, yes she still has read/write authorization on that shared drive.

    Here is the code. The line which generates the error is to the bottom of the code and is the line which starts with "objWord.ActiveDocument.SaveAs Filename:="P:\Finance\....."
    Please Login or Register  to view this content.
    Thanks!

  2. #2
    Forum Contributor
    Join Date
    01-17-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    211

    Re: Run-time error when saving with macro

    your string :
    Please Login or Register  to view this content.
    versus
    Please Login or Register  to view this content.
    -are you sure each cell that is referd to is containing data and in the correct format ?
    -does any of those cells contain formulas ? e.g. (Today-1) and are you sure this users has his regional setting (time & date) setup the same as you ?
    (one of the reasons you should be using the format fucntion when working with dates and times if file is used on different pc's )

    ( had the same issue once and it did take me half a day before i realised the person getting the error had his regional settings on mm/dd/yy as others had it on dd/mm/yy )
    If solved remember to mark Thread as solved , to mark your thread as Solved select Thread Tools and click Mark thread as Solved.

    I can't read the mind of my wife so then I get picture but no sound .... and then I mostly get the idea, same goes here picture your outcome and I get the idea.

  3. #3
    Forum Contributor
    Join Date
    07-26-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2016 Office 365 ProPlus
    Posts
    826

    Re: Run-time error when saving with macro

    Hi hulpeloos,
    Thanks you for saving me that 1/2 day! You were right it were the date settings....
    She now was able to generate the document without saving errors.

    But just out of curiousity, how would I change my code with the format function you stated?
    Thanks.

  4. #4
    Forum Contributor
    Join Date
    01-17-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    211

    Re: Run-time error when saving with macro

    e.g.
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VBA Run Time Error when saving workbook between Users....?
    By slu2383 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 12-28-2012, 04:22 PM
  2. Run Time Error 1004 when saving to a Sharepoint
    By Benbo in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-07-2012, 09:46 AM
  3. Run time error (Err=9) when saving file using saveas
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-24-2012, 10:14 AM
  4. Run-Time Error 438 when saving
    By Buk in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-29-2011, 05:48 PM
  5. Error Saving after running Macro
    By millen in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-05-2007, 09:14 AM

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1