简体   繁体   English

使用Excel的Excel存储过程

[英]Excel Stored Procedure with Excel

I have stored proc Im pulling in to excel but to get it to Run I have to enter my text exec roc 'Name' I need it to be able to have someone else thats running it be able to enter a name as they refresh the data. 我已将proc Im存储到excel中,但要使其运行,必须输入我的文本exec roc'Name',我需要它能够让其他人运行它,以便在刷新数据时输入名称。 I dont know VBA at all and am looking for help. 我一点都不了解VBA,正在寻求帮助。

I don't completely understand your question but if my assumption is correct... you want to have a cell where someone can enter some sort of name, where you can then use their input to do some other operations. 我不完全理解您的问题,但是如果我的假设正确,那么...您想要一个单元格,在该单元格中,某人可以输入某种名称,然后您可以在该单元格中使用他们的输入进行其他操作。

To start, you would want to grab a string variable (by grab I mean create) 首先,您需要获取一个字符串变量(通过获取,我的意思是创建)

Example: 例:

Dim strName As String

Then you would want to be able to read a specific cell.... In the next example the cell will be A2 然后,您将希望能够读取特定的单元格。...在下一个示例中,该单元格将为A2

Example: 例:

strName = Range("Sheet1!A2").Value

If you named the first sheet something different use that name. 如果您为第一张图纸命名,则使用其他名称。 If the user inputs a name into that cell you can then use it later to do calculations or anything you want. 如果用户在该单元格中输入了名称,则可以稍后使用它进行计算或执行任何所需的操作。

If you are not using VBA code then what are you using? 如果您不使用VBA代码,那么您正在使用什么?

If using MS Query, try changing the SQL text to 如果使用MS Query,请尝试将SQL文本更改为

{CALL roc(?)}

and IIRC this should prompt the user to enter text for the parameter value. 和IIRC,这将提示用户输入参数值的文本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM