locked
Print filename in excel ActiveX Button RRS feed

  • Discussão Geral

  • I need help please:

    I have a speadsheet excel 2007. In that speadsheet I have an "ActiveX button Control" for printing to email for sending to other people. The macro reads as such:

    Private Sub EmailWorksheetExecute_Click()
    '
    ' email Macro
    '

    '
        ActiveWorkbook.ExportAsFixedFormat Type:=xlTypeXPS, Filename:= _
            "C:\Users\JONDOM~1.000\AppData\Local\Temp\Peer Group Report.xps", Quality:= _
            xlQualityStandard, IncludeDocProperties:=False, IgnorePrintAreas:=False, _
            OpenAfterPublish:=False
        Application.Dialogs(xlDialogSendMail).Show
    End Sub

    The problem I have is this button only works on my machine because of the "Filename:= "C:\Users\JONDOM~1.000\AppData\Local\Temp\Peer Group Report.xps",

    Now, I am using this speadsheet on multiple PC's on differnet domains, but it will not work anywhere lse unless it is on my machine from where I created the spreadsheet.

    I would like to wirte a universal line that will print this spreadsheet on any machine on any domain, when button is clicked on, not just from the address that is stated above.

    Also the spreadsheet needs to compatible with 97-2003.

    Please I need helpe and look forward to your reply.

    Many thanks

    Jonathan

     

    quarta-feira, 16 de fevereiro de 2011 07:12