Click here to Skip to main content
15,881,852 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear sir / mam

i have an code in excel ( VISUAL BASIC FOR APPLICATION ), i had tried a lot to convert that code to visual basic.net but i had failed , and ever time i got error

so i request you to provide me the code in vb.net for the vba code


If Not ActiveWorkbook.MultiUserEditing Then
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs ActiveWorkbook.Name, accessmode:=xlShared
Application.DisplayAlerts = True
MsgBox "Now Shared"
End If

thankyou

What I have tried:

Dim xlApp As excel.Application
Dim xlWorkBook As excel.Workbook
Dim xlWorkSheet As excel.Worksheet
xlApp = New excel.Application
xlWorkBook = xlApp.Workbooks.Open("D:\program gann\NEST.xls")
xlWorkSheet = xlWorkBook.Worksheets("NEST-Sheet1")

ActiveWorkbook = xlWorkBook

ActiveWorkbook.SaveAs(ActiveWorkbook.Name, xlWorkSheet.accessmode := xlShared)
Posted
Comments
[no name] 14-Jul-16 3:08am    
Maybe reading this would help: Converting Code from VBA to Visual Basic .NET[^]
Patrice T 14-Jul-16 3:16am    
I request you to give error informations and position in code.
URGENT

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900