大家好,感谢您对此问题的投入。
我昨晚在公共汽车上骑车时解决了这个问题。
我想我只需要暂时离开它并考虑一下这里发生了什么。
解决方案原来是我需要使用Workbooks.Add(模板)命令而不是试图打开templatedirectly.Al -----原始消息-----来自:Garvin,AlSent:2003年3月25日,星期二
3:11 PMTo:VEE vrfSubject:[vrf]问题调用Excel模板。我正在Vee 6.01中编写一个调用Excel电子表格的应用程序。当我调用电子表格时,我立即关闭空白电子表格并打开一个名为Plot_Lband.xlt的模板。
然后将数据写入电子表格,并根据输入创建图表。
当我打开模板时,它被命名为“Plot_Lband1”。
在制作图表后,我对新文件名(DD_NEW)执行“另存为”,然后尝试关闭工作簿和应用程序。
当我这样做时,写入新文件,长度为242K字节。
但是工作簿和应用程序保持打开状态,Iam询问我是否要保存对“Plot_Lband1”所做的更改。
无论如何Ianswer这个问题,被写入的文件(DD_NEW)将无法在Excel中正常打开。
现在,如果我不退出VEE(退出VEE应用程序)但再次运行程序,那么下次我打开模板时它被命名为“Plot_Lband2”,并且在图表生成后,“另存为”Excel文件(DD_NEW1)为82K
字节长,工作簿和应用程序正常关闭,没有关于保存对PlaceLband2的更改的问题。
我创建的文件DD_NEW1在Excel中正常打开。如果我继续创建文件而不退出VEE应用程序,则newtemplate文件按预期命名为Plot_Lband3,Plot_Lband4。
如果我退出VEE应用程序并重新启动它,第一个模板文件名为“Plot_Lband1”,使用另存为创建的第一个Excel文件长度为242K字节且不可读,每个后续文件长度为82 K字节,并且很好。这是一些
代码我在公式窗口中使用。设置ExcelWkbk = createObject(“Excel.Sheet”);
//启动ExcelSet ExcelApp = ExcelWkbk.Application;
//分配applicationobjectExcelApp.Visible = TRUE;
//制作ExcelvisibleExcelWkbk.Close(); ExcelApp.Workbooks.Open(xlsFileSpec);
//打开我们的templatexlsFileSpec = D:LMTK_dataemplatesPlot_Lband.xlsset ExcelWkbk = ExcelApp.Workbooks(1); ExcelWkbk.Windows(1).WindowState = xlMaximized;设置Wks = ExcelApp.WorkSheets(1); ExcelApp.caption = meas_title; Wks.Activatesheet
在这里填充数据并获取图表.Closing就像thisExcelWkbk.SaveAs(file_name);
// file_name = DD_NEWExcelWkbk.Close(False);
//这会关闭saveas fileExcelApp.quit();通常当您在Excel中执行“另存为”时,标题栏会使用保存文件时使用的新名称。在这种情况下,第一次通过代码执行标题栏
是没有改变,而是有人问我是否要保存对Plot_Lband1.Again的更改而不退出VEE,下次通过代码,之后保存因为标题块现在说Microshft Excel - DD_NEW.Anyone有什么想法我
我在这里做错了吗?谢谢,Al GarvinLockheed Martin ---您目前订阅了vrf:al.garvin@lmco.com要订阅,请发送一封空白电子邮件至“join-vrf@it.lists.it.agilent.com”。
要取消订阅,请发送一封空白电子邮件至“leave-vrf@it.lists.it.agilent.com”。要发送邮件到此邮件列表,请发送电子邮件至“vrf@it.lists.it.agilent.com”。如果您需要帮助
邮件列表发送邮件至“owner-vrf@it.lists.it.agilent.com”.---您目前订阅了vrf:r***@soco.agilent.com要订阅,请发送空白电子邮件至“加入”
-vrf@it.lists.it.ag
ilent.com“。要取消订阅,请发送一封空白电子邮件至”leave-vrf@it.lists.it.agilent.com“。要发送邮件至此邮件列表,请发送电子邮件至”vrf@it.lists.it.agilent.com“
。
如果您需要有关邮件列表的帮助,请发送邮件至“owner-vrf@it.lists.it.agilent.com”。
以上来自于谷歌翻译
以下为原文
Hi all,
Thanks for the input on this problem. I solved it last night while riding
home on the bus. I guess I just needed to get
away from it for a while and think about what was going on here. The
solution turned out to be that I needed to use the
Workbooks.Add(template) command instead of trying to open the template
directly.
Al
-----Original Message-----
From: Garvin, Al
Sent: Tuesday, March 25, 2003 3:11 PM
To: VEE vrf
Subject: [vrf] Problem calling Excel templates.
Hi,
I am writing an application in Vee 6.01 which calls an Excel spreadsheet.
When I call the spreadsheet I immediately close the blank spreadheet and
open a template
called Plot_Lband.xlt. Data is then written to the spreadsheet and a chart
is created from the input. When I open the template it is named
"Plot_Lband1". After the chart is
made I do a "Save As" to a new file name(DD_NEW) and then try to close the
workbook and the application. When I do this, the new file is written and
it is 242K bytes long. But the workbook and application stays open and I
am asked if I want to save changes made to "Plot_Lband1". No matter how I
answer this question, the file that was
written (DD_NEW) will not open properly in Excel. Now , if I do not exit
from VEE(quit the VEE application) but run the program again, then next
time I open the template it is named "Plot_Lband2" and after the chart is
made, the "Save As" Excel file (DD_NEW1) is 82K bytes long, the workbook
and application close normally with no questions about saving changes to
Plot_Lband2. And the file I have created DD_NEW1 opens normally in Excel.
If I continue on making files without quiting the VEE application the new
template files are named Plot_Lband3, Plot_Lband4 as expected. If I quit
the VEE application and restart it, the first template file is named
"Plot_Lband1" and the first Excel file created with Save As is 242K bytes
long and unreadable and each subsequent file is 82 K bytes long and is fine.
Here is some of the code I am using in a formula window.
Set ExcelWkbk=createObject("Excel.Sheet"); // Launch Excel
Set ExcelApp=ExcelWkbk.Application; // Assign the application
object
ExcelApp.Visible = TRUE; // Make Excel
visible
ExcelWkbk.Close();
ExcelApp.Workbooks.Open(xlsFileSpec); // Open our template
xlsFileSpec = D:LMTK_data emplatesPlot_Lband.xls
set ExcelWkbk = ExcelApp.Workbooks(1);
ExcelWkbk.Windows(1).WindowState = xlMaximized;
Set Wks = ExcelApp.WorkSheets(1);
ExcelApp.caption = meas_title;
Wks.Activate
sheet gets filled with data here and chart gets made.
Closing is like this
ExcelWkbk.SaveAs(file_name); // file_name = DD_NEW
ExcelWkbk.Close(False); // this closes the saveas file
ExcelApp.quit();
Normally when you do a "Save As" in Excel the title block takes on the new
name used when you save the file.
In this case, the first time through the code the title block is not
changed and instead I am asked if I want to save changes to Plot_Lband1.
Again without getting out of VEE, the next time through the code, after the
Save As the title block now says Microshft Excel -- DD_NEW.
Anyone have any ideas what I am doing wrong here?
Thanks,
Al Garvin
Lockheed Martin
---
You are currently subscribed to vrf as:
al.garvin@lmco.com
To subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list, email "vrf@it.lists.it.agilent.com".
If you need help with the mailing list send a message to
"owner-vrf@it.lists.it.agilent.com".
---
You are currently subscribed to vrf as: [email=r***@soco.agilent.com]r***@soco.agilent.com[/email]
To subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list, email "vrf@it.lists.it.agilent.com".
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".
大家好,感谢您对此问题的投入。
我昨晚在公共汽车上骑车时解决了这个问题。
我想我只需要暂时离开它并考虑一下这里发生了什么。
解决方案原来是我需要使用Workbooks.Add(模板)命令而不是试图打开templatedirectly.Al -----原始消息-----来自:Garvin,AlSent:2003年3月25日,星期二
3:11 PMTo:VEE vrfSubject:[vrf]问题调用Excel模板。我正在Vee 6.01中编写一个调用Excel电子表格的应用程序。当我调用电子表格时,我立即关闭空白电子表格并打开一个名为Plot_Lband.xlt的模板。
然后将数据写入电子表格,并根据输入创建图表。
当我打开模板时,它被命名为“Plot_Lband1”。
在制作图表后,我对新文件名(DD_NEW)执行“另存为”,然后尝试关闭工作簿和应用程序。
当我这样做时,写入新文件,长度为242K字节。
但是工作簿和应用程序保持打开状态,Iam询问我是否要保存对“Plot_Lband1”所做的更改。
无论如何Ianswer这个问题,被写入的文件(DD_NEW)将无法在Excel中正常打开。
现在,如果我不退出VEE(退出VEE应用程序)但再次运行程序,那么下次我打开模板时它被命名为“Plot_Lband2”,并且在图表生成后,“另存为”Excel文件(DD_NEW1)为82K
字节长,工作簿和应用程序正常关闭,没有关于保存对PlaceLband2的更改的问题。
我创建的文件DD_NEW1在Excel中正常打开。如果我继续创建文件而不退出VEE应用程序,则newtemplate文件按预期命名为Plot_Lband3,Plot_Lband4。
如果我退出VEE应用程序并重新启动它,第一个模板文件名为“Plot_Lband1”,使用另存为创建的第一个Excel文件长度为242K字节且不可读,每个后续文件长度为82 K字节,并且很好。这是一些
代码我在公式窗口中使用。设置ExcelWkbk = createObject(“Excel.Sheet”);
//启动ExcelSet ExcelApp = ExcelWkbk.Application;
//分配applicationobjectExcelApp.Visible = TRUE;
//制作ExcelvisibleExcelWkbk.Close(); ExcelApp.Workbooks.Open(xlsFileSpec);
//打开我们的templatexlsFileSpec = D:LMTK_dataemplatesPlot_Lband.xlsset ExcelWkbk = ExcelApp.Workbooks(1); ExcelWkbk.Windows(1).WindowState = xlMaximized;设置Wks = ExcelApp.WorkSheets(1); ExcelApp.caption = meas_title; Wks.Activatesheet
在这里填充数据并获取图表.Closing就像thisExcelWkbk.SaveAs(file_name);
// file_name = DD_NEWExcelWkbk.Close(False);
//这会关闭saveas fileExcelApp.quit();通常当您在Excel中执行“另存为”时,标题栏会使用保存文件时使用的新名称。在这种情况下,第一次通过代码执行标题栏
是没有改变,而是有人问我是否要保存对Plot_Lband1.Again的更改而不退出VEE,下次通过代码,之后保存因为标题块现在说Microshft Excel - DD_NEW.Anyone有什么想法我
我在这里做错了吗?谢谢,Al GarvinLockheed Martin ---您目前订阅了vrf:al.garvin@lmco.com要订阅,请发送一封空白电子邮件至“join-vrf@it.lists.it.agilent.com”。
要取消订阅,请发送一封空白电子邮件至“leave-vrf@it.lists.it.agilent.com”。要发送邮件到此邮件列表,请发送电子邮件至“vrf@it.lists.it.agilent.com”。如果您需要帮助
邮件列表发送邮件至“owner-vrf@it.lists.it.agilent.com”.---您目前订阅了vrf:r***@soco.agilent.com要订阅,请发送空白电子邮件至“加入”
-vrf@it.lists.it.ag
ilent.com“。要取消订阅,请发送一封空白电子邮件至”leave-vrf@it.lists.it.agilent.com“。要发送邮件至此邮件列表,请发送电子邮件至”vrf@it.lists.it.agilent.com“
。
如果您需要有关邮件列表的帮助,请发送邮件至“owner-vrf@it.lists.it.agilent.com”。
以上来自于谷歌翻译
以下为原文
Hi all,
Thanks for the input on this problem. I solved it last night while riding
home on the bus. I guess I just needed to get
away from it for a while and think about what was going on here. The
solution turned out to be that I needed to use the
Workbooks.Add(template) command instead of trying to open the template
directly.
Al
-----Original Message-----
From: Garvin, Al
Sent: Tuesday, March 25, 2003 3:11 PM
To: VEE vrf
Subject: [vrf] Problem calling Excel templates.
Hi,
I am writing an application in Vee 6.01 which calls an Excel spreadsheet.
When I call the spreadsheet I immediately close the blank spreadheet and
open a template
called Plot_Lband.xlt. Data is then written to the spreadsheet and a chart
is created from the input. When I open the template it is named
"Plot_Lband1". After the chart is
made I do a "Save As" to a new file name(DD_NEW) and then try to close the
workbook and the application. When I do this, the new file is written and
it is 242K bytes long. But the workbook and application stays open and I
am asked if I want to save changes made to "Plot_Lband1". No matter how I
answer this question, the file that was
written (DD_NEW) will not open properly in Excel. Now , if I do not exit
from VEE(quit the VEE application) but run the program again, then next
time I open the template it is named "Plot_Lband2" and after the chart is
made, the "Save As" Excel file (DD_NEW1) is 82K bytes long, the workbook
and application close normally with no questions about saving changes to
Plot_Lband2. And the file I have created DD_NEW1 opens normally in Excel.
If I continue on making files without quiting the VEE application the new
template files are named Plot_Lband3, Plot_Lband4 as expected. If I quit
the VEE application and restart it, the first template file is named
"Plot_Lband1" and the first Excel file created with Save As is 242K bytes
long and unreadable and each subsequent file is 82 K bytes long and is fine.
Here is some of the code I am using in a formula window.
Set ExcelWkbk=createObject("Excel.Sheet"); // Launch Excel
Set ExcelApp=ExcelWkbk.Application; // Assign the application
object
ExcelApp.Visible = TRUE; // Make Excel
visible
ExcelWkbk.Close();
ExcelApp.Workbooks.Open(xlsFileSpec); // Open our template
xlsFileSpec = D:LMTK_data emplatesPlot_Lband.xls
set ExcelWkbk = ExcelApp.Workbooks(1);
ExcelWkbk.Windows(1).WindowState = xlMaximized;
Set Wks = ExcelApp.WorkSheets(1);
ExcelApp.caption = meas_title;
Wks.Activate
sheet gets filled with data here and chart gets made.
Closing is like this
ExcelWkbk.SaveAs(file_name); // file_name = DD_NEW
ExcelWkbk.Close(False); // this closes the saveas file
ExcelApp.quit();
Normally when you do a "Save As" in Excel the title block takes on the new
name used when you save the file.
In this case, the first time through the code the title block is not
changed and instead I am asked if I want to save changes to Plot_Lband1.
Again without getting out of VEE, the next time through the code, after the
Save As the title block now says Microshft Excel -- DD_NEW.
Anyone have any ideas what I am doing wrong here?
Thanks,
Al Garvin
Lockheed Martin
---
You are currently subscribed to vrf as:
al.garvin@lmco.com
To subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list, email "vrf@it.lists.it.agilent.com".
If you need help with the mailing list send a message to
"owner-vrf@it.lists.it.agilent.com".
---
You are currently subscribed to vrf as: [email=r***@soco.agilent.com]r***@soco.agilent.com[/email]
To subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list, email "vrf@it.lists.it.agilent.com".
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".
举报