简体   繁体   English

数据库查询:从Excel电子表格导入数据。 没有它,就无法打开该电子表格。

[英]Database Query: Importing data from an excel spreadsheet. Without it opening that spreadsheet.

I am doing a database query import from another excel spreadsheet. 我正在从另一个Excel电子表格进行数据库查询导入。 And every time it updates it opens up the spreadsheet that it is pulling the information from. 每次更新时,都会打开从中提取信息的电子表格。 I do not want this to happen. 我不希望这种情况发生。 Any thoughts on what I should look into to stop this from happening? 我有什么想法可以阻止这种情况的发生?

Although I think that this workbook being open could lead to other problems, to get a handle back to your workbook try... 尽管我认为打开此工作簿可能会导致其他问题,但请设法尝试一下...

If Err.Number = (The error number you get) then
    Set xlWorkbook = GetObject("C:\Test\MyWb.xlsx", "Excel.Application")
end if

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

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