2 Replies Latest reply on Nov 26, 2015 4:08 AM by info@seaqconsulting.com.au

    Exported Excel VBA Get Current User Name

    info@seaqconsulting.com.au

      I have a Filemaker Pro runtime DB that exports reports to Excel then opens in PDF, there is no problems running this on my machine but.....when a customer loads it onto there machine the VBA code (Current Username) needs to change. One big hurdle for me is to be able to distribute the Excel forms with my solution and have Excel know the different User name. So below is part of my VBA, I need to be able to change the SEAQ(Win or Current application user name) to the Current User name on my customer machine.....export to Location is documents, I don't need to change that part as the forms will be located in their documents folder for people to change as needed.


      ActiveWorkbook.UpdateLink Name:= _
        
      "C:\Users\seaq\Documents\LAB 17025\Forms\Particle Distribution\PD FM Exported.xlsx" _
        
      , Type:=xlExcelLinks

      Selection
      .ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
        
      "C:\Users\seaq\Documents\LAB 17025\Forms\Particle Distribution\Particle Dist Customer Report.pdf" _
        
      , Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
        
      :=False, OpenAfterPublish:=True