Quantcast

[belajar-excel] membuat workbook baru dan menjalankan macro di workbook tersebut

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[belajar-excel] membuat workbook baru dan menjalankan macro di workbook tersebut

the_x_mikey
hi all,

tolong bantuannya membuat macro seperti judul diatas dong.

deskripsi :
saya mau membuat commandbutton (di file A) yg jika diklik, user harus memilih file excel (file b) dimana macro akan berjalan di file A tersebut.

saya sudah coba

newfile = application.getopenfilename(filefilter:="Excel Files (*.xls),*.xls", title:="please select a file")

tapi sayangnya macro saya berjalan di file A sehingga terjadi error.

bagaimana cara membuat file B menjadi aktif setelah dibuat

thanks in advance
Mike



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [belajar-excel] membuat workbook baru dan menjalankan macro di workbook tersebut

the_x_mikey
saya ralat

deskripsi :

saya mau membuat commandbutton (di file A) yg jika diklik, user harus memilih file excel (file b) dimana macro akan berjalan di file B tersebut.


Sent from my BlackBerry yg belum lunas

-----Original Message-----
From: "Chubby Mike" <[hidden email]>
Sender: [hidden email]
Date: Wed, 28 Mar 2012 09:52:09
To: <[hidden email]>
Reply-To: [hidden email]
Subject: [belajar-excel] membuat workbook baru dan menjalankan macro di workbook tersebut

hi all,

tolong bantuannya membuat macro seperti judul diatas dong.

deskripsi :
saya mau membuat commandbutton (di file A) yg jika diklik, user harus memilih file excel (file b) dimana macro akan berjalan di file A tersebut.

saya sudah coba

newfile = application.getopenfilename(filefilter:="Excel Files (*.xls),*.xls", title:="please select a file")

tapi sayangnya macro saya berjalan di file A sehingga terjadi error.

bagaimana cara membuat file B menjadi aktif setelah dibuat

thanks in advance
Mike




Kid
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [belajar-excel] membuat workbook baru dan menjalankan macro di workbook tersebut

Kid
Administrator
In reply to this post by the_x_mikey
Mungkin begini :

    Dim vFile As Variant
    Dim wbkFile As Workbook
    vFile = Application.GetOpenFilename("Excel Files (*.xls), *.xls")
    If LenB(vFile) <> 0 Then
        Set wbkFile = Workbooks.Open(vFile)
    End If

Kemudian semua kegiatan di file B bisa dilakukan dengan memanggil object
wbkFile
Misal :
wbkfile.activate
wbkfile.sheets(1).activate
wbkfile.sheets(1).range("d3:h19,z55:ab77").clearcontents

Kid.

On Wed, Mar 28, 2012 at 16:52, Chubby Mike <[hidden email]> wrote:

> **
>
>
> hi all,
>
> tolong bantuannya membuat macro seperti judul diatas dong.
>
> deskripsi :
> saya mau membuat commandbutton (di file A) yg jika diklik, user harus
> memilih file excel (file b) dimana macro akan berjalan di file A tersebut.
>
> saya sudah coba
>
> newfile = application.getopenfilename(filefilter:="Excel Files
> (*.xls),*.xls", title:="please select a file")
>
> tapi sayangnya macro saya berjalan di file A sehingga terjadi error.
>
> bagaimana cara membuat file B menjadi aktif setelah dibuat
>
> thanks in advance
> Mike
>
>  
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [belajar-excel] membuat workbook baru dan menjalankan macro di workbook tersebut

the_x_mikey
Hi kid, code yg kamu berikan itu berjalan dengan sempurna,
Boleh nanya 1 lg ga?
Dalam macro yg sy buat itu membuat 1 workbook baru lg(file c), dari tadi saya coba otak atik.
Kalau vfile dibawah itu artinya file yg dipilih sm user, gmn cara membuat vfile itu adalah workbook yg kita buat baru.
Sent from my BlackBerry yg belum lunas

-----Original Message-----
From: "Kid Mr." <[hidden email]>
Sender: [hidden email]
Date: Wed, 28 Mar 2012 17:11:49
To: <[hidden email]>
Reply-To: [hidden email]
Subject: Re: [belajar-excel] membuat workbook baru dan menjalankan macro di
 workbook tersebut

Mungkin begini :

    Dim vFile As Variant
    Dim wbkFile As Workbook
    vFile = Application.GetOpenFilename("Excel Files (*.xls), *.xls")
    If LenB(vFile) <> 0 Then
        Set wbkFile = Workbooks.Open(vFile)
    End If

Kemudian semua kegiatan di file B bisa dilakukan dengan memanggil object
wbkFile
Misal :
wbkfile.activate
wbkfile.sheets(1).activate
wbkfile.sheets(1).range("d3:h19,z55:ab77").clearcontents

Kid.

On Wed, Mar 28, 2012 at 16:52, Chubby Mike <[hidden email]> wrote:

> **
>
>
> hi all,
>
> tolong bantuannya membuat macro seperti judul diatas dong.
>
> deskripsi :
> saya mau membuat commandbutton (di file A) yg jika diklik, user harus
> memilih file excel (file b) dimana macro akan berjalan di file A tersebut.
>
> saya sudah coba
>
> newfile = application.getopenfilename(filefilter:="Excel Files
> (*.xls),*.xls", title:="please select a file")
>
> tapi sayangnya macro saya berjalan di file A sehingga terjadi error.
>
> bagaimana cara membuat file B menjadi aktif setelah dibuat
>
> thanks in advance
> Mike
>
>  
>

Kid
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [belajar-excel] membuat workbook baru dan menjalankan macro di workbook tersebut

Kid
Administrator
Coba :

dim wbkNew as workbook
set wbknew=workbooks.add
wbknew.saveas "z:\data\namafilebaru.xlsx"

Kid.

On Wed, Mar 28, 2012 at 21:02, ChubbyMike <[hidden email]> wrote:

> **
>
>
> ** Hi kid, code yg kamu berikan itu berjalan dengan sempurna,
> Boleh nanya 1 lg ga?
> Dalam macro yg sy buat itu membuat 1 workbook baru lg(file c), dari tadi
> saya coba otak atik.
> Kalau vfile dibawah itu artinya file yg dipilih sm user, gmn cara membuat
> vfile itu adalah workbook yg kita buat baru.
> Sent from my BlackBerry yg belum lunas
> ------------------------------
> *From: * "Kid Mr." <[hidden email]>
> *Sender: * [hidden email]
> *Date: *Wed, 28 Mar 2012 17:11:49 +0700
> *To: *<[hidden email]>
> *ReplyTo: * [hidden email]
> *Subject: *Re: [belajar-excel] membuat workbook baru dan menjalankan
> macro di workbook tersebut
>
>
>
> Mungkin begini :
>
>     Dim vFile As Variant
>     Dim wbkFile As Workbook
>     vFile = Application.GetOpenFilename("Excel Files (*.xls), *.xls")
>     If LenB(vFile) <> 0 Then
>         Set wbkFile = Workbooks.Open(vFile)
>     End If
>
> Kemudian semua kegiatan di file B bisa dilakukan dengan memanggil object
> wbkFile
> Misal :
> wbkfile.activate
> wbkfile.sheets(1).activate
> wbkfile.sheets(1).range("d3:h19,z55:ab77").clearcontents
>
> Kid.
>
> On Wed, Mar 28, 2012 at 16:52, Chubby Mike <[hidden email]> wrote:
>
>> **
>>
>>
>> hi all,
>>
>> tolong bantuannya membuat macro seperti judul diatas dong.
>>
>> deskripsi :
>> saya mau membuat commandbutton (di file A) yg jika diklik, user harus
>> memilih file excel (file b) dimana macro akan berjalan di file A tersebut.
>>
>> saya sudah coba
>>
>> newfile = application.getopenfilename(filefilter:="Excel Files
>> (*.xls),*.xls", title:="please select a file")
>>
>> tapi sayangnya macro saya berjalan di file A sehingga terjadi error.
>>
>> bagaimana cara membuat file B menjadi aktif setelah dibuat
>>
>> thanks in advance
>> Mike
>>
>>
>  
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [belajar-excel] membuat workbook baru dan menjalankan macro di workbook tersebut

the_x_mikey
Hi kid,

Sy sudah coba code ini dibawah tp tidak dpt disave dan tidak bisa bikin value di wbknew, malahan ada error 400
Dim vFile As Variant
    Dim wbkFile As Workbook
    vFile = Application.GetOpenFilename
    If LenB(vFile) <> 0 Then
        Set wbkFile = Workbooks.Open(vFile)
    End If
wbkfile.activate
wbkfile.sheets(1).activate
wbkfile.sheets(1).range("a1").select
Selection.entirerow.insert
Activecell.value ="abc"

Dim wbknew as workbook
Set wbknew = workbooks.add
Wbknew.saveas "c:\tes\tes.xls"
Wbknew.range("a2").value = "bca"


Sent from my BlackBerry yg belum lunas

-----Original Message-----
From: "Kid Mr." <[hidden email]>
Sender: [hidden email]
Date: Wed, 28 Mar 2012 21:37:10
To: <[hidden email]>
Reply-To: [hidden email]
Subject: Re: [belajar-excel] membuat workbook baru dan menjalankan macro di
 workbook tersebut

Coba :

dim wbkNew as workbook
set wbknew=workbooks.add
wbknew.saveas "z:\data\namafilebaru.xlsx"

Kid.

On Wed, Mar 28, 2012 at 21:02, ChubbyMike <[hidden email]> wrote:

> **
>
>
> ** Hi kid, code yg kamu berikan itu berjalan dengan sempurna,
> Boleh nanya 1 lg ga?
> Dalam macro yg sy buat itu membuat 1 workbook baru lg(file c), dari tadi
> saya coba otak atik.
> Kalau vfile dibawah itu artinya file yg dipilih sm user, gmn cara membuat
> vfile itu adalah workbook yg kita buat baru.
> Sent from my BlackBerry yg belum lunas
> ------------------------------
> *From: * "Kid Mr." <[hidden email]>
> *Sender: * [hidden email]
> *Date: *Wed, 28 Mar 2012 17:11:49 +0700
> *To: *<[hidden email]>
> *ReplyTo: * [hidden email]
> *Subject: *Re: [belajar-excel] membuat workbook baru dan menjalankan
> macro di workbook tersebut
>
>
>
> Mungkin begini :
>
>     Dim vFile As Variant
>     Dim wbkFile As Workbook
>     vFile = Application.GetOpenFilename("Excel Files (*.xls), *.xls")
>     If LenB(vFile) <> 0 Then
>         Set wbkFile = Workbooks.Open(vFile)
>     End If
>
> Kemudian semua kegiatan di file B bisa dilakukan dengan memanggil object
> wbkFile
> Misal :
> wbkfile.activate
> wbkfile.sheets(1).activate
> wbkfile.sheets(1).range("d3:h19,z55:ab77").clearcontents
>
> Kid.
>
> On Wed, Mar 28, 2012 at 16:52, Chubby Mike <[hidden email]> wrote:
>
>> **
>>
>>
>> hi all,
>>
>> tolong bantuannya membuat macro seperti judul diatas dong.
>>
>> deskripsi :
>> saya mau membuat commandbutton (di file A) yg jika diklik, user harus
>> memilih file excel (file b) dimana macro akan berjalan di file A tersebut.
>>
>> saya sudah coba
>>
>> newfile = application.getopenfilename(filefilter:="Excel Files
>> (*.xls),*.xls", title:="please select a file")
>>
>> tapi sayangnya macro saya berjalan di file A sehingga terjadi error.
>>
>> bagaimana cara membuat file B menjadi aktif setelah dibuat
>>
>> thanks in advance
>> Mike
>>
>>
>  
>

Kid
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [belajar-excel] membuat workbook baru dan menjalankan macro di workbook tersebut

Kid
Administrator
Jika error pada baris saveas, maka pastikan folder dan akses ke drivenya
ada.
Yang jelas, baris :
*Wbknew.range("a2").value = "bca"*
jelas salah, karena tidak memenuhi kaidah object model yang ada, yaitu :

Workbook.Sheet.Range

Jadi range("a2") itu harusnya disebut ketika nama sheetnya sudah disebut
lebih dulu.

Kid.

On Wed, Mar 28, 2012 at 21:54, ChubbyMike <[hidden email]> wrote:

> **
>
>
> ** Hi kid,
>
> Sy sudah coba code ini dibawah tp tidak dpt disave dan tidak bisa bikin
> value di wbknew, malahan ada error 400
> Dim vFile As Variant
>     Dim wbkFile As Workbook
>     vFile = Application.GetOpenFilename
>     If LenB(vFile) <> 0 Then
>         Set wbkFile = Workbooks.Open(vFile)
>     End If
> wbkfile.activate
> wbkfile.sheets(1).activate
> wbkfile.sheets(1).range("a1").select
> Selection.entirerow.insert
> Activecell.value ="abc"
>
> Dim wbknew as workbook
> Set wbknew = workbooks.add
> Wbknew.saveas "c:\tes\tes.xls"
> Wbknew.range("a2").value = "bca"
>
>
> Sent from my BlackBerry yg belum lunas
> ------------------------------
> *From: * "Kid Mr." <[hidden email]>
> *Sender: * [hidden email]
> *Date: *Wed, 28 Mar 2012 21:37:10 +0700
> *To: *<[hidden email]>
> *ReplyTo: * [hidden email]
> *Subject: *Re: [belajar-excel] membuat workbook baru dan menjalankan
> macro di workbook tersebut
>
>
>
> Coba :
>
> dim wbkNew as workbook
> set wbknew=workbooks.add
> wbknew.saveas "z:\data\namafilebaru.xlsx"
>
> Kid.
>
> On Wed, Mar 28, 2012 at 21:02, ChubbyMike <[hidden email]> wrote:
>
>> **
>>
>>
>> ** Hi kid, code yg kamu berikan itu berjalan dengan sempurna,
>> Boleh nanya 1 lg ga?
>> Dalam macro yg sy buat itu membuat 1 workbook baru lg(file c), dari tadi
>> saya coba otak atik.
>> Kalau vfile dibawah itu artinya file yg dipilih sm user, gmn cara membuat
>> vfile itu adalah workbook yg kita buat baru.
>> Sent from my BlackBerry yg belum lunas
>> ------------------------------
>> *From: * "Kid Mr." <[hidden email]>
>> *Sender: * [hidden email]
>> *Date: *Wed, 28 Mar 2012 17:11:49 +0700
>> *To: *<[hidden email]>
>> *ReplyTo: * [hidden email]
>> *Subject: *Re: [belajar-excel] membuat workbook baru dan menjalankan
>> macro di workbook tersebut
>>
>>
>>
>> Mungkin begini :
>>
>>     Dim vFile As Variant
>>     Dim wbkFile As Workbook
>>     vFile = Application.GetOpenFilename("Excel Files (*.xls), *.xls")
>>     If LenB(vFile) <> 0 Then
>>         Set wbkFile = Workbooks.Open(vFile)
>>     End If
>>
>> Kemudian semua kegiatan di file B bisa dilakukan dengan memanggil object
>> wbkFile
>> Misal :
>> wbkfile.activate
>> wbkfile.sheets(1).activate
>> wbkfile.sheets(1).range("d3:h19,z55:ab77").clearcontents
>>
>> Kid.
>>
>> On Wed, Mar 28, 2012 at 16:52, Chubby Mike <[hidden email]> wrote:
>>
>>> **
>>>
>>>
>>> hi all,
>>>
>>> tolong bantuannya membuat macro seperti judul diatas dong.
>>>
>>> deskripsi :
>>> saya mau membuat commandbutton (di file A) yg jika diklik, user harus
>>> memilih file excel (file b) dimana macro akan berjalan di file A tersebut.
>>>
>>> saya sudah coba
>>>
>>> newfile = application.getopenfilename(filefilter:="Excel Files
>>> (*.xls),*.xls", title:="please select a file")
>>>
>>> tapi sayangnya macro saya berjalan di file A sehingga terjadi error.
>>>
>>> bagaimana cara membuat file B menjadi aktif setelah dibuat
>>>
>>> thanks in advance
>>> Mike
>>>
>>>
>>
>  
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [belajar-excel] membuat workbook baru dan menjalankan macro di workbook tersebut

the_x_mikey
Ic, jadi harusnya wbknew.sheets(1).range("a2").value = "bca" ya

Thanks a lot Kid
Sent from my BlackBerry yg belum lunas

-----Original Message-----
From: "Kid Mr." <[hidden email]>
Sender: [hidden email]
Date: Wed, 28 Mar 2012 22:12:41
To: <[hidden email]>
Reply-To: [hidden email]
Subject: Re: [belajar-excel] membuat workbook baru dan menjalankan macro di
 workbook tersebut

Jika error pada baris saveas, maka pastikan folder dan akses ke drivenya
ada.
Yang jelas, baris :
*Wbknew.range("a2").value = "bca"*
jelas salah, karena tidak memenuhi kaidah object model yang ada, yaitu :

Workbook.Sheet.Range

Jadi range("a2") itu harusnya disebut ketika nama sheetnya sudah disebut
lebih dulu.

Kid.

On Wed, Mar 28, 2012 at 21:54, ChubbyMike <[hidden email]> wrote:

> **
>
>
> ** Hi kid,
>
> Sy sudah coba code ini dibawah tp tidak dpt disave dan tidak bisa bikin
> value di wbknew, malahan ada error 400
> Dim vFile As Variant
>     Dim wbkFile As Workbook
>     vFile = Application.GetOpenFilename
>     If LenB(vFile) <> 0 Then
>         Set wbkFile = Workbooks.Open(vFile)
>     End If
> wbkfile.activate
> wbkfile.sheets(1).activate
> wbkfile.sheets(1).range("a1").select
> Selection.entirerow.insert
> Activecell.value ="abc"
>
> Dim wbknew as workbook
> Set wbknew = workbooks.add
> Wbknew.saveas "c:\tes\tes.xls"
> Wbknew.range("a2").value = "bca"
>
>
> Sent from my BlackBerry yg belum lunas
> ------------------------------
> *From: * "Kid Mr." <[hidden email]>
> *Sender: * [hidden email]
> *Date: *Wed, 28 Mar 2012 21:37:10 +0700
> *To: *<[hidden email]>
> *ReplyTo: * [hidden email]
> *Subject: *Re: [belajar-excel] membuat workbook baru dan menjalankan
> macro di workbook tersebut
>
>
>
> Coba :
>
> dim wbkNew as workbook
> set wbknew=workbooks.add
> wbknew.saveas "z:\data\namafilebaru.xlsx"
>
> Kid.
>
> On Wed, Mar 28, 2012 at 21:02, ChubbyMike <[hidden email]> wrote:
>
>> **
>>
>>
>> ** Hi kid, code yg kamu berikan itu berjalan dengan sempurna,
>> Boleh nanya 1 lg ga?
>> Dalam macro yg sy buat itu membuat 1 workbook baru lg(file c), dari tadi
>> saya coba otak atik.
>> Kalau vfile dibawah itu artinya file yg dipilih sm user, gmn cara membuat
>> vfile itu adalah workbook yg kita buat baru.
>> Sent from my BlackBerry yg belum lunas
>> ------------------------------
>> *From: * "Kid Mr." <[hidden email]>
>> *Sender: * [hidden email]
>> *Date: *Wed, 28 Mar 2012 17:11:49 +0700
>> *To: *<[hidden email]>
>> *ReplyTo: * [hidden email]
>> *Subject: *Re: [belajar-excel] membuat workbook baru dan menjalankan
>> macro di workbook tersebut
>>
>>
>>
>> Mungkin begini :
>>
>>     Dim vFile As Variant
>>     Dim wbkFile As Workbook
>>     vFile = Application.GetOpenFilename("Excel Files (*.xls), *.xls")
>>     If LenB(vFile) <> 0 Then
>>         Set wbkFile = Workbooks.Open(vFile)
>>     End If
>>
>> Kemudian semua kegiatan di file B bisa dilakukan dengan memanggil object
>> wbkFile
>> Misal :
>> wbkfile.activate
>> wbkfile.sheets(1).activate
>> wbkfile.sheets(1).range("d3:h19,z55:ab77").clearcontents
>>
>> Kid.
>>
>> On Wed, Mar 28, 2012 at 16:52, Chubby Mike <[hidden email]> wrote:
>>
>>> **
>>>
>>>
>>> hi all,
>>>
>>> tolong bantuannya membuat macro seperti judul diatas dong.
>>>
>>> deskripsi :
>>> saya mau membuat commandbutton (di file A) yg jika diklik, user harus
>>> memilih file excel (file b) dimana macro akan berjalan di file A tersebut.
>>>
>>> saya sudah coba
>>>
>>> newfile = application.getopenfilename(filefilter:="Excel Files
>>> (*.xls),*.xls", title:="please select a file")
>>>
>>> tapi sayangnya macro saya berjalan di file A sehingga terjadi error.
>>>
>>> bagaimana cara membuat file B menjadi aktif setelah dibuat
>>>
>>> thanks in advance
>>> Mike
>>>
>>>
>>
>  
>

vw
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [belajar-excel] membuat workbook baru dan menjalankan macro di workbook tersebut

vw
In reply to this post by Kid
maaf jadi pgn ikutan nanya juga ya.

bagaimana bila filter getopenfilename nya dengan 2 extensi atau lebih ( *.xls dan *.xlsx atau *.xlsm) ?

------- Original message -------

> From: Kid Mr. <[hidden email]>
> To: [hidden email]
> Sent: 28.3.,  17:12
>
>  
>
> Mungkin begini :
>
>     Dim vFile As Variant
>     Dim wbkFile As Workbook
>     vFile = Application.GetOpenFilename("Excel Files (*.xls), *.xls")
>     If LenB(vFile) <> 0 Then
>         Set wbkFile = Workbooks.Open(vFile)
>     End If
>
> Kemudian semua kegiatan di file B bisa dilakukan dengan memanggil object wbkFile
> Misal :
> wbkfile.activate
> wbkfile.sheets(1).activate
> wbkfile.sheets(1).range("d3:h19,z55:ab77").clearcontents
>
> Kid.
>
> On Wed, Mar 28, 2012 at 16:52, Chubby Mike <[hidden email]> wrote:
>>  
>>
>> hi all,
>>
>> tolong bantuannya membuat macro seperti judul diatas dong.
>>
>> deskripsi :
>> saya mau membuat commandbutton (di file A) yg jika diklik, user harus memilih file excel (file b) dimana macro akan berjalan di file A tersebut.
>>
>> saya sudah coba
>>
>> newfile = application.getopenfilename(filefilter:="Excel Files (*.xls),*.xls", title:="please select a file")
>>
>> tapi sayangnya macro saya berjalan di file A sehingga terjadi error.
>>
>> bagaimana cara membuat file B menjadi aktif setelah dibuat
>>
>> thanks in advance
>> Mike
>>
>>
>

Kid
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [belajar-excel] membuat workbook baru dan menjalankan macro di workbook tersebut

Kid
Administrator
Coba :

    Dim v As Variant
    v = Application.GetOpenFilename("Excel files (*.xlsm;*.xls),
*.xlsm;*.xls")

Kid.

On Thu, Mar 29, 2012 at 14:21, <[hidden email]> wrote:

> **
>
>
> maaf jadi pgn ikutan nanya juga ya.
>
> bagaimana bila filter getopenfilename nya dengan 2 extensi atau lebih (
> *.xls dan *.xlsx atau *.xlsm) ?
>
>
> ------- Original message -------
> > From: Kid Mr. <[hidden email]>
> > To: [hidden email]
> > Sent: 28.3., 17:12
> >
> >
> >
> > Mungkin begini :
> >
> >     Dim vFile As Variant
> >     Dim wbkFile As Workbook
> >     vFile = Application.GetOpenFilename("Excel Files (*.xls), *.xls")
> >     If LenB(vFile) <> 0 Then
> >         Set wbkFile = Workbooks.Open(vFile)
> >     End If
> >
> > Kemudian semua kegiatan di file B bisa dilakukan dengan memanggil object
> wbkFile
> > Misal :
> > wbkfile.activate
> > wbkfile.sheets(1).activate
> > wbkfile.sheets(1).range("d3:h19,z55:ab77").clearcontents
> >
> > Kid.
> >
> > On Wed, Mar 28, 2012 at 16:52, Chubby Mike <[hidden email]>
> wrote:
> >>
> >>
> >> hi all,
> >>
> >> tolong bantuannya membuat macro seperti judul diatas dong.
> >>
> >> deskripsi :
> >> saya mau membuat commandbutton (di file A) yg jika diklik, user harus
> memilih file excel (file b) dimana macro akan berjalan di file A tersebut.
> >>
> >> saya sudah coba
> >>
> >> newfile = application.getopenfilename(filefilter:="Excel Files
> (*.xls),*.xls", title:="please select a file")
> >>
> >> tapi sayangnya macro saya berjalan di file A sehingga terjadi error.
> >>
> >> bagaimana cara membuat file B menjadi aktif setelah dibuat
> >>
> >> thanks in advance
> >> Mike
> >>
> >>
> >
>
>  
>
vw
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [belajar-excel] membuat workbook baru dan menjalankan macro di workbook tersebut

vw
terima kasih mr.kid

------- Original message -------

> From: Kid Mr. <[hidden email]>
> To: [hidden email]
> Sent: 29.3.,  14:29
>
>  
>
> Coba :
>
>     Dim v As Variant
>     v = Application.GetOpenFilename("Excel files (*.xlsm;*.xls), *.xlsm;*.xls")
>
> Kid.
>
> On Thu, Mar 29, 2012 at 14:21, <[hidden email]> wrote:
>>  
>>
>> maaf jadi pgn ikutan nanya juga ya.
>>
>> bagaimana bila filter getopenfilename nya dengan 2 extensi atau lebih ( *.xls dan *.xlsx atau *.xlsm) ?
>>
>>
>> ------- Original message -------
>>> From: Kid Mr. <[hidden email]>
>>> To: [hidden email]
>>> Sent: 28.3., 17:12
>>>
>>>  
>>>
>>> Mungkin begini :
>>>
>>>     Dim vFile As Variant
>>>     Dim wbkFile As Workbook
>>>     vFile = Application.GetOpenFilename("Excel Files (*.xls), *.xls")
>>>     If LenB(vFile) <> 0 Then
>>>         Set wbkFile = Workbooks.Open(vFile)
>>>     End If
>>>
>>> Kemudian semua kegiatan di file B bisa dilakukan dengan memanggil object wbkFile
>>> Misal :
>>> wbkfile.activate
>>> wbkfile.sheets(1).activate
>>> wbkfile.sheets(1).range("d3:h19,z55:ab77").clearcontents
>>>
>>> Kid.
>>>
>>> On Wed, Mar 28, 2012 at 16:52, Chubby Mike <[hidden email]> wrote:
>>>>  
>>>>
>>>> hi all,
>>>>
>>>> tolong bantuannya membuat macro seperti judul diatas dong.
>>>>
>>>> deskripsi :
>>>> saya mau membuat commandbutton (di file A) yg jika diklik, user harus memilih file excel (file b) dimana macro akan berjalan di file A tersebut.
>>>>
>>>> saya sudah coba
>>>>
>>>> newfile = application.getopenfilename(filefilter:="Excel Files (*.xls),*.xls", title:="please select a file")
>>>>
>>>> tapi sayangnya macro saya berjalan di file A sehingga terjadi error.
>>>>
>>>> bagaimana cara membuat file B menjadi aktif setelah dibuat
>>>>
>>>> thanks in advance
>>>> Mike
>>>>
>>>>
>>>
>>
>>
>>
>

Loading...