投稿日 | : 2003/09/26(Fri) 09:12 |
投稿者 | : 初心者 |
Eメール | : t.igawa@microtv.co.jp |
URL | : |
タイトル | : Re: Re9: ファイルリストからExclを開く |
これが全てのコードです。
おかしなところがありましたら、教えてもらえますか?
Public xlApp As Excel.Application
Public xlBook As Excel.Workbook
Public xlSheet As Excel.Worksheet
Private Sub Command1_Click()
On Error Resume Next
Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Open("Dir1.Path & " \ " & File2"
)
Set xlSheet = xlBook.Worksheets(1)
xlApp.Visible = True
End Sub
Private Sub Command2_Click()
xlSheet.Pictures.Insert Dir1.Path & "\" & File1
'3.54 4.73
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path
File2.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
Public Sub File1_Click()
Image1.Stretch = True
Dim file As String
Dim myshape As Shape
Image1.Picture = LoadPicture(Dir1.Path & "\" & File1)
End Sub
Private Sub Form_Load()
Dim lngPosX As Long
Dim lngPosY As Long
Const HWND_TOPMOST = (-1)
Const SWP_NOSIZE = &H1
Const SWP_NOMOVE = &H2
lngPosX = Me.Left / Screen.TwipsPerPixelX
lngPosY = Me.Top / Screen.TwipsPerPixelY
SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE Or SWP_NOMOVE
Drive1.Drive = "c"
End Sub