Results 1 to 2 of 2
  1. #1
    Join Date
    May 2014

    Unanswered: Run time error 3011

    I am trying to add run the

    Private Sub Command40_Click()
    Dim oExcel As New Excel.Application
    Dim oWb As Excel.Workbook
    Dim oSheet As Excel.Worksheet
    Dim fileName As String

    oExcel.Workbooks.Open (CurrentProject.Path & "\" & "TrainingPlanExcel.xlsX")
    oExcel.Visible = True
    Set oWb = oExcel.Workbooks(1)
    Set oSheet = oExcel.ActiveWorkbook.Worksheets("sheet1")
    oSheet.Unprotect ("qwerty")

    Set dbMyDatabase = CurrentDb()

    oSheet.Cells(3, 3) = Forms!employeepillarteamskillsselect!DeptName
    fileName = "F:\Training-F620\New Folder\R Database\TrainingPlanExcel.xlsX"
    DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "CLASSTYPE", fileName, True, ""

    oSheet.Protect ("qwerty")
    Set oSheet = Nothing
    Set oWb = Nothing
    Set oExcel = Nothing
    End Subon shared network drive. I keep on getting error 3011. I don't know why. It's exporting the query fine in C drive (local drive).

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    So which line do you get the error
    What is the error message?
    It could be anything
    It could be permissions yoy dont have the required righrs to do something
    It could be relative paths. Does f drive exist on the faulting machine.
    Does the relative path in f drive exist. On networked multi user applications refer to server shares as opposed to drive letters, unless you know tge drive letter exists on all machines
    Wrap such code ibside an error handler that caters for missing disk resources

    Is the Excel current triaing plan in the current project
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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