Bruce
08-22-2004, 11:13 PM
Hello everyone...
I am accessing a popup and using a viewer to take a gander at some excel sheets. The problem is, the .xls file names look like this "Family Monthly Budget.xls" but the viewer says it can't find "Family.xls". Why is it chopping the name up? Could I be doing something wrong? (HAR HAR HAR)
This is my code:
--define the tables that will be used
tblMenuItem={}
tblPopup = {};
--define a counter variable
ctr = 0;
--Get all the files on in the folder, store them in a table
tblFiles = File.Find("AutoPlay\\Docs\\excelshow\\", "*.xls", false, false, nil)
--if there are no files, skip the popup
if tblFiles ~= nil then
--loop through the files found on the desktop
for n, sFiles in tblFiles do
--split the path into a table
tblPath=String.SplitPath(sFiles);
--increment counter
ctr = ctr + 1;
--define the row in the table with place holder text
tblMenuItem[ctr]={text=tblPath.Filename,type=[[0]],checked=[[false]],enabled=[[t
rue]]}
--insert into the PopUp
Table.Insert(tblPopup, Table.Count(tblPopup) + 1, tblMenuItem[ctr])
end
--get the labels position and size
tblPos = Label.GetPos("Extras Label");
tblSize = Label.GetSize("Extras Label");
x = tblPos.X;
y = tblPos.Y + tblSize.Height;
--show the popup
result = PopupMenu.Show(tblPopup, x, y, PopupMenu.HALIGN_LEFT, PopupMenu.VALIGN_TOP);
if result ~= "CANCELLED" then
File.Run("AutoPlay\\Docs\\excel\\XLVIEW.EXE", "AutoPlay\\Docs\\excelshow\\".. result ..".xls", "", SW_SHOWNORMAL, false);
end
end
I am accessing a popup and using a viewer to take a gander at some excel sheets. The problem is, the .xls file names look like this "Family Monthly Budget.xls" but the viewer says it can't find "Family.xls". Why is it chopping the name up? Could I be doing something wrong? (HAR HAR HAR)
This is my code:
--define the tables that will be used
tblMenuItem={}
tblPopup = {};
--define a counter variable
ctr = 0;
--Get all the files on in the folder, store them in a table
tblFiles = File.Find("AutoPlay\\Docs\\excelshow\\", "*.xls", false, false, nil)
--if there are no files, skip the popup
if tblFiles ~= nil then
--loop through the files found on the desktop
for n, sFiles in tblFiles do
--split the path into a table
tblPath=String.SplitPath(sFiles);
--increment counter
ctr = ctr + 1;
--define the row in the table with place holder text
tblMenuItem[ctr]={text=tblPath.Filename,type=[[0]],checked=[[false]],enabled=[[t
rue]]}
--insert into the PopUp
Table.Insert(tblPopup, Table.Count(tblPopup) + 1, tblMenuItem[ctr])
end
--get the labels position and size
tblPos = Label.GetPos("Extras Label");
tblSize = Label.GetSize("Extras Label");
x = tblPos.X;
y = tblPos.Y + tblSize.Height;
--show the popup
result = PopupMenu.Show(tblPopup, x, y, PopupMenu.HALIGN_LEFT, PopupMenu.VALIGN_TOP);
if result ~= "CANCELLED" then
File.Run("AutoPlay\\Docs\\excel\\XLVIEW.EXE", "AutoPlay\\Docs\\excelshow\\".. result ..".xls", "", SW_SHOWNORMAL, false);
end
end