advanced help
per page, with , order by , clip by
Results of 1 - 1 of about 58 for CurrentDirectory (0.000 sec.)
[[20201123235640]]
#score: 13656
@digest: 9764478aa7abb552256caa5b28f865ac
@id: 85864
@mdate: 2020-11-24T06:40:53Z
@size: 2007
@type: text/plain
#keywords: 所" (17466), 管場 (14715), タ保 (14127), currentdirectory (12881), タ(* (6766), 保管 (5739), 朝倉 (5627), deta (3722), 所指 (3694), wscript (2839), 場所 (1687), beginner (1485), 度マ (1430), shell (1085), ドッ (1081), アロ (1049), officetanaka (1035), chdir (999), ダイ (996), createobject (940), ト? (937), クマ (814), ュメ (808), ト検 (773), ーネ (744), getopenfilename (732), ドキ (713), 無け (642), イア (565), explicit (543), 起動 (507), 火) (498)
『フォルダの場所指定について』(朝倉東)
こんにちは。教えて頂けたらと思いまして投稿させて頂きます。 インターネットで調べながら簡易的なマクロを組んでいるのですが With CreateObject("wscript.shell") currentdirectory = "C:¥データ保管場所" End With や ChDir "C:¥データ保管場所" でデータを開く場所を指定しているのですが マクロを起動してダイアログの一回目は場所を指定してくれずに 何も指定しなかった時のドキュメント?が表示され あれ、と思いもう一度マクロを起動してダイアログを開くと 今度は指定のフォルダを表示してくれる事が何度かあります。 PCのスペックなのか根本的に間違っているのかわからずです。 回避する手段はありましたら教えて頂けたらと思います。 Sub ダイアログで開いて読み込む() Dim deta As String With CreateObject("wscript.shell") currentdirectory = "C:¥データ保管場所" End With deta = Application.GetOpenFilename("サンプルデータ (*.txt),*.txt") If deta = "False" Then Exit Sub Workbooks.Open Target End Sub < 使用 Excel:Excel2019、使用 OS:Windows10 > ---- ネット検索した情報だけですみませんが、 http://officetanaka.net/excel/vba/file/file02.htm のように、 ChDir "C:¥データ保管場所" の前に、 ChDrive "C" を入れてみてどうでしょうか。 (QS) 2020/11/24(火) 00:41 ---- > With CreateObject("wscript.shell") > currentdirectory = "C:¥データ保管場所" > End With スペル合ってるのか見てないけど、他でエラーになるでしょ。 適当に書いています?、 (Why) 2020/11/24(火) 02:59 ---- Option Explicit書いて無ければエラーにならないので、単に気がついてないのでは? CurrentDirectoryの前にドットを付けたらどうなりますかね。 With CreateObject("wscript.shell") .CurrentDirectory = "C:¥データ保管場所" End With それと、モジュールの一行目に「Option Explicit」が無ければ追加してください。 (通りすがり) 2020/11/24(火) 09:42 ---- 参考まで。 http://officetanaka.net/excel/vba/beginner/11.htm (リンクマン) 2020/11/24(火) 15:40 ...
https://www.excel.studio-kazu.jp/wiki/kazuwiki/202011/20201123235640.txt - [detail] - similar
PREV NEXT
Powered by Hyper Estraier 1.4.13, with 97045 documents and 608224 words.

訪問者:カウンタValid HTML 4.01 Transitional