rrenis Posted August 4, 2008 Share Posted August 4, 2008 Hi all, I guess this is easy but I can't get it to work I have the following code which I need to open a speadsheet but it assumes each word of the spreadsheet name is a seperate spreadsheet and therefore tries to open 'example.xls', 'spreadsheet.xls', 'with.xls' etc... Does anyone know what to alter in order for this to work? $file_location = "example spreasheet with username attached - " & @username Run("C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE" & " " & $file_location & "") Cheers, rrenis Link to comment Share on other sites More sharing options...
sigil Posted August 4, 2008 Share Posted August 4, 2008 Search the forums for the ExcelCOM UDF. It has functions, such as _ExcelBookOpen, for opening Excel spreadsheets; these functions accept strings with spaces in them. Link to comment Share on other sites More sharing options...
rrenis Posted August 4, 2008 Author Share Posted August 4, 2008 Search the forums for the ExcelCOM UDF. It has functions, such as _ExcelBookOpen, for opening Excel spreadsheets; these functions accept strings with spaces in them.Thanks for the quick response sigil Link to comment Share on other sites More sharing options...
picaxe Posted August 4, 2008 Share Posted August 4, 2008 Try $file_location = "example spreasheet with username attached - " & @username Run("f:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE" & ' "' & $file_location & '"') Link to comment Share on other sites More sharing options...
rrenis Posted August 4, 2008 Author Share Posted August 4, 2008 Try $file_location = "example spreasheet with username attached - " & @username Run("f:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE" & ' "' & $file_location & '"') That work's great - many thanks!!! Cheers, rrenis Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now