Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sharepoint vs Excel

Status
Not open for further replies.

jrobin5881

Technical User
Mar 10, 2004
228
US
Good Morning,

I built an Excel app using VBA and a series of Userforms that I migrated up to a Sharepoint site. The file runs fine on my local machine but gives me an error message when run from Sharepoint.

DETAILS:
I hide the application in the background when the workbook is opened.
Code:
Private Sub Workbook_Open()

'Hide workbook

   Application.Visible = False


' Splash Screen appearance

    FrmSplash.Show
    
    Dim NewControl As CommandBarControl
' Assign shortcut to display calendar on SHIFT+CTRL+C
    Application.OnKey "+^{C}", "Module1.OpenCalendar"
' Add item to shortcut menu on open
    On Error Resume Next
    Application.CommandBars("Cell").Controls("Insert Date").Delete
    On Error GoTo 0
    Set NewControl = Application.CommandBars("Cell").Controls.Add
    With NewControl
        .Caption = "Insert Date"
        .OnAction = "Module1.OpenCalendar"
        .BeginGroup = True
    End With
    
 
    frmMain.Show
    
     
End Sub

The main screen has a series of textboxes, Name, Date, etc etc. that are completed first by the end user. There are a series of command buttons below that takes the end user to an appropriate userform screen that has another series of text boxes. Code below is click event for a button on the main form.

Code:
Private Sub cmd2_Click()
 
If Optcheck Then
  Select Case frmMain.opt1
    Case Is = True
      
     Frm210.MultiPage1.Value = 0
     Frm210.MultiPage1.Pages(1).Visible = False
    
    Case Else
      
      Frm210.MultiPage1.Value = 1
      Frm210.MultiPage1.Pages(0).Visible = False
      
  End Select
  
     'Move value from Name,FSDO and Date cbo and text boxes to Quarterly sheet.
      MainInfo
    Unload frmMain
   Frm210.Show

End If

End Sub

The user once again fills out a series of textboxes and upon completion clicks a "Save" command button on the bottom of the userform. The save as dialog pops and the user can save the file to their local machine. As I said it works fine when the file that is stored on my desktop is run. However when running the file from Sharepoint I get a message: "Runtime Error '1004 show method of dialog class failed" with the line Application.Dialogs(xlDialogSaveAs).Show highlighted. I'm using Office 2003 loaded on winxp and the file is loaded into a folder in the Documents and lists sections of sharepoint.

Any help would be appreciated.

**Code below is from the "Save" command button"
Code:
Private Sub CommandButton9_Click()

'************************************************************
'* THIS SECTION MOVES THE INFORMATION FROM THE USERFORM TO THE
'* SPREADSHEET FOR THE MANAGERS VIEWING
'************************************************************
 
 'increments target row of cellS
    ct = 14
    l = 2
    
    For ct = 14 To 38

        Sheet29.Cells(ct, 4) = Me.Controls("TextBox" & l).Text
    
        l = l + 1
    
    Next

'************************************************************
'*Below saves and closes the workbook
'************************************************************

   [COLOR=red yellow]Application.Dialogs(xlDialogSaveAs).Show[/color]
  
    ActiveWorkbook.Close False
    
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top