Help with Runtime error 75


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Help with Runtime error 75

  1. #1
    Join Date
    Aug 2009
    Posts
    37

    Help with Runtime error 75

    Hi,

    I am working on a piece of code which checks to see if a particular directory name exists and if not created it, later saving an excel file into it. It works well first time, but when teh code tries to open and save another file in this same directory it returns error 75

    I know its because the created directory is Read Only. How do I set the ditrectroy access writes at the time of craetion?

    It seems that it does not even allow me to change it manually from the properties dialogue? Here is teh code:

    Code:
    Sub ArchiveFile()
    
    
    Dim strDN As String
    Dim strFN As String
    
    ChDir "G:\PUBS\PP-MS\INVOICES"
    
    strDN = Range("E5")
    
    MsgBox strDN
    
    'If Len(Dir("c:\Instructions.doc")) = 0 Then
    If Dir("G:\PUBS\PP-MS\INVOICES\" & strDN) = "" Then
    
    
    MkDir ("G:\PUBS\PP-MS\INVOICES\" & strDN)
        Else
            'do nothing as the directory already exists
            'MsgBox "C:\Text Files\ directory already exists"
        End If
    
    strFN = Range("K2") & ".xls"
    
    MsgBox strFN
    
    ChDir "G:\PUBS\PP-MS\INVOICES\" & strDN
    
    ActiveWorkbook.SaveAs Filename:=strFN, _
            FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
            ReadOnlyRecommended:=False, CreateBackup:=False
    
    
    End Sub
    Will be grateful for any help on this.

    Thanks,

    Talāt

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

Similar Threads

  1. Replies: 0
    Last Post: 05-15-2008, 05:24 PM
  2. Runtime libraries installation
    By Rahul Dixit in forum C++
    Replies: 5
    Last Post: 07-18-2005, 08:21 PM
  3. Java Runtime
    By Sam in forum Java
    Replies: 3
    Last Post: 04-08-2002, 11:24 AM
  4. Replies: 0
    Last Post: 04-05-2002, 12:23 AM
  5. wot is CLR
    By lostguy in forum .NET
    Replies: 8
    Last Post: 04-03-2002, 07:41 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center