/* */

Wednesday, March 30, 2011

[belajar-access] Re: TransferSpreadsheet acExport utk worksheet yg ter-protect

Coba buat di module .

' centang di menu :
' [tools] , [references] ,[microsoft zz.z object library]
' zz.z versi office , misal office 2010 zz.z -> 14.0
sub isiselwsprotect
Dim objexcel As Excel.Application
Dim mWorkBook As Excel.Workbook
Dim msheet As Excel.Worksheet

Set objexcel = Excel.Application

sFullPath = CurrentProject.Path & "\Shorum.xls"

With objexcel

.Visible = False
Set mWorkBook = .Workbooks.Open(sFullPath)

Set msheet = .Sheets("sheet1")
msheet.Unprotect ("coba")
msheet.Cells(8, 1).Select
ActiveCell.Value = "isi"
msheet.Protect ("coba")
mWorkBook.Close savechanges:=True
.Quit
End With

semoga berguna
'=========

--- In belajar-access@yahoogroups.com, "hasimnurhsm@..." <hasimnurhsm@...> wrote:
>
> hallo mas. hendra..codenya di buat di access, maaf kl saya salah menafsirkan kl berkenan kirim saja file access dan file excel yg terprotectnya.., soalnya saya masih meraba2 maksud mas. mungkin menambah data dari access ke excel pada cell tertentu saja. pada sheet yg terprotect.
>
> salam
>
> Nurhasim Hasan
>
> --- On Fri, 25/3/11, Hendra Agestha Hamid <the_agestha@...> wrote:
>
> From: Hendra Agestha Hamid <the_agestha@...>
> Subject: Re: [belajar-access] TransferSpreadsheet acExport utk worksheet yg ter-protect
> To: belajar-access@yahoogroups.com
> Received: Friday, 25 March, 2011, 4:28 AM
>
>
>
>
>
>
>
>  
>
>
>
>
>
>
>
>
>
> Tengkyu mas...
> Maksud saya excelnya sdh terprotect, gimana caranya proses export ke excel tsb tetap bisa .... btw coding yg mas kasih itu ditulis di Vba accessnya atau
> di vba excelnya mas...?
> Regards
> Hendra
>
>
> From: "hasimnurhsm@..." <hasimnurhsm@...>
> To: belajar-access@yahoogroups.com
> Sent: Fri, March 25, 2011 4:00:17 PM
> Subject: Re: [belajar-access] TransferSpreadsheet acExport utk worksheet yg ter-protect
>
>
>
>
>
>
>
>
>
>  
>
>
>
>
>
>
> waduh mas. hendra mungkin cara saya agak ribet nich...tp siapa tahu para suhu ada yang lebih simple..caranya sbb:
>
> pertama pake rumus export biasa spt ini:
>
> DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "Bkup_Ctrl", "G:\Stuff.xls", True
>  
> kedua secara program kita buka lagi file excelnya, baru kita kasih protect/password sheetnya spt ini:
>
> Dim oxl As Object
> Dim oexcel As Object
> Dim sfullpath As String
> Dim spath As String
>
> Set
> oxl =
> CreateObject("excel.application")
> sfullpath = "G:\Stuff.xls"
>     With oxl
>         .Visible = False
>         .Workbooks.Open (sfullpath)
>         For I = 1 To .Sheets.Count
>             nmsheet = .Sheets(I).Name
>             .Sheets(nmsheet).Protect
> ("cobaaja")
>         Next I
>     End With
>    
>     oxl.Save
>     oxl.Quit
>
> silahkan disesuaikan dengan kebutuhan mas. h
> endra
>
> salam
>
> Nurhasim Hasan
>
>
>
> --- On Mon, 21/3/11, Hendra Agestha Hamid <the_agestha@...> wrote:
>
> From: Hendra Agestha Hamid <the_agestha@...>
> Subject: [belajar-access] TransferSpreadsheet acExport utk worksheet yg
> ter-protect
> To: belajar-access@yahoogroups.com
> Received: Monday, 21 March, 2011, 8:58 PM
>
>
>
>
>
>
>
>  
>
>
>
>
>
>
> Dear warga milis,...
>
> Bagaimana caranya kita melakukan TransferSpreadsheet acExport tapi worksheet di excel tsb kita set terprotect dgn sebuah password..?
>
> Terima kasih
> Regards
> Hendra
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>  
>


------------------------------------

SPAM IS PROHIBITEDYahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/belajar-access/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/belajar-access/join
(Yahoo! ID required)

<*> To change settings via email:
belajar-access-digest@yahoogroups.com
belajar-access-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
belajar-access-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/

No comments:

Post a Comment