Hi all,
Stupid, basic question I am sure, but I am having trouble having a VBScript file open & access data from an xlsx file. My method works fine for .txt and .csv files, but not sure on the syntax needed for .xlsx files.
set FSO_source = createobject("Excel.Application")
set source_file = FSO_source.workbooks.open("C:\Data\file.xlsx", 1)
source_content = source_file.ReadAll 'trouble is here
parse_content = split(source_content, " ")
count = parse_content(2)
msgbox count
the excel object doesn't seem to like .ReadAll, tho it seems to work fine for .csv and .txt files
Essentially what I am trying to do is get 3rd word of the source document, located in A1 if opened in excel.
Thanks in advance!
-o
Stupid, basic question I am sure, but I am having trouble having a VBScript file open & access data from an xlsx file. My method works fine for .txt and .csv files, but not sure on the syntax needed for .xlsx files.
set FSO_source = createobject("Excel.Application")
set source_file = FSO_source.workbooks.open("C:\Data\file.xlsx", 1)
source_content = source_file.ReadAll 'trouble is here
parse_content = split(source_content, " ")
count = parse_content(2)
msgbox count
the excel object doesn't seem to like .ReadAll, tho it seems to work fine for .csv and .txt files
Essentially what I am trying to do is get 3rd word of the source document, located in A1 if opened in excel.
Thanks in advance!
-o